CS Awesome - Unit 8 Vocabulary

0.0(0)
Studied by 20 people
0%Unit 8 Mastery
0%Exam Mastery
Build your Mastery score
multiple choiceMultiple Choice
call kaiCall Kai
Supplemental Materials
Card Sorting

1/8

flashcard set

Earn XP

Last updated 5:09 PM on 4/21/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

9 Terms

1
New cards
2d Array
An array that holds items in a two dimensional grid. You can think of it as storing items in rows and columns (like a bingo card or battleship game). You can access an item (element) at a given row and column index.
2
New cards
2d Array Declaration
To declare an array, specify the type of elements that will be stored in the array, then ([][]) to show that it is a 2d array of that type, then at least one space, and then a name for the array. Examples: int[][] seats; String[][] seatingChart;
3
New cards
2d Array Creation
To create a 2d array, type the name and an equals sign then use the new keyword, followed by a space, then the type, and then [numRows][numCols]. Example: seatingChart \= new String[5][4];. This will have 5 rows and 4 columns.
4
New cards
2d Array Index
You can access and set values in a 2d array using the row and column index. The first element in an array called arr is at row 0 and column 0 arr[0][0].
5
New cards
2d Array Initialization
You can also initialize (set) the values in the array when you first create it. In this case you don't need to specify the size of the array, it will be determined from the number of values that you specify. Example: String[][] seatingInfo \= { {"Jamal", "Maria"}, {"Jake", "Suzy"}, {"Emma", "Luke"}}; This will create a 2d array with 3 rows and 2 columns.
6
New cards
2d Array Number of Rows
The number of rows (or height) is the length of the outer array. For an array arr use arr.length to get the number of rows in the array.
7
New cards
2d Array Number of Columns
The number of columns (or width) is the length of the inner array. For an array arr use arr[0].length to get the number of columns.
8
New cards
nested for loop
A for loop inside of another for loop. These are used to loop through all the elements in a 2d array. One loop can work through the rows and the other the columns.
9
New cards
out of bounds error
This happens when a loop goes beyond the last valid index in an array. Remember that the last valid row index is arr.length - 1. The last valid column index is arr[0].length - 1.

Explore top notes

note
Chapter 3 (65-75)
Updated 1292d ago
0.0(0)
note
Chapter 29- Fungi
Updated 1189d ago
0.0(0)
note
Energy Requirement in Humans
Updated 1156d ago
0.0(0)
note
Chapter 18 - Biotechnology
Updated 1309d ago
0.0(0)
note
Chapter 3 (65-75)
Updated 1292d ago
0.0(0)
note
Chapter 29- Fungi
Updated 1189d ago
0.0(0)
note
Energy Requirement in Humans
Updated 1156d ago
0.0(0)
note
Chapter 18 - Biotechnology
Updated 1309d ago
0.0(0)

Explore top flashcards

flashcards
Dynamic Process of Breathing
50
Updated 124d ago
0.0(0)
flashcards
Spanish 1 - Gustar Helpful Words
33
Updated 1211d ago
0.0(0)
flashcards
Lab 7: Hematology
77
Updated 480d ago
0.0(0)
flashcards
IgM blood systems (P)
35
Updated 552d ago
0.0(0)
flashcards
La Comida vocab, parte 2
33
Updated 217d ago
0.0(0)
flashcards
Science Final (7th Grade)
27
Updated 1034d ago
0.0(0)
flashcards
Dynamic Process of Breathing
50
Updated 124d ago
0.0(0)
flashcards
Spanish 1 - Gustar Helpful Words
33
Updated 1211d ago
0.0(0)
flashcards
Lab 7: Hematology
77
Updated 480d ago
0.0(0)
flashcards
IgM blood systems (P)
35
Updated 552d ago
0.0(0)
flashcards
La Comida vocab, parte 2
33
Updated 217d ago
0.0(0)
flashcards
Science Final (7th Grade)
27
Updated 1034d ago
0.0(0)