User Input
Conditionals
if-statement
Nested if-statements
switch-case statements
Loops
while loop
do-while loop
for loop
Indexed sequence of values of the same type
Example:
52 playing cards in a deck
1 million characters in a book
130 students in this course sorted by their ID
Goal: 10 variables of type int
Goal: 10 variables of type int
Declares, creates, and initializes values
To make an array, declare, create and initialize it.
To access element 'i' of an array named ‘a’, use a[i].
Array indices start at 0.
Declare, create, and initialize in one statement.
Default initialization: all numbers automatically set to 0.
Dot product of two vectors
Examples:
Table of grades for each student and assignment
Table of data for each experiment and outcome
Mathematical abstraction: Matrix
Java abstraction: 2D array
Array Access: use a[i][j] to access element in row i and column j.
Zero-based indexing: Row and column indices start at 0.
Matrix Addition