What do you have to put after the type (primitive or String) to make an array?
What are brackets ([])
What are the two types of loops you can use to traverse through an array?
What are for loops (including enhanced for loops) and while loops?
How do you change a value in an array?
What is (array name)[array index] = (new value)?
What will the following code segment print?
int[] arr = {1, 2, 3, 4, 5,};
System.out.print(arr[1]);
A) 0
B) 1
C) 2
D) 3
What is C?
Name 3 classes Mr. Baun has taught.
Intro to Comp Sci, APCSA, Python, Honors Java, Game Design I and II, Pathways, Web Design, Intro to Business
Define an array.
What is an object that stores multiple values in a single "container"? The values have to be of the same type.
When looping through an array, what code could you use to print out each value in an array?
for(int i = 0; i < arr.length; i++)
{
(your code here)
}
What is (System.out.println(arr[i]);)?
Can you use .remove() with arrays (not ArrayLists)?
What is No?
String[] names = {"Jack", "Michael", "Baun"};
What is the index of the String "Baun"?
A) 0
B) 1
C) 2
D) 3
What is C?
Has Mr. Baun run a marathon? (True or False)
Extremely True
How do you instantiate a blank array of a set size?
What is (int[] n1 = new int[number];)?
What is the format for an enhanced for loop?
(use int[] arr in your signature)
What is: (for(int n : arr))?
Is .add() an Array method, an ArrayList method, both, or neither?
What is an ArrayList method?
Which of these is correct?
A: int n1 = {1, 4, 6, 8};
B: int[] n2 = {1, 4, 6, 8};
C: String[] n3 = {1, 4, 6, 8};
What is B?
What did Mr. Baun major in?
What is Education?
Can you make a boolean array? (Yes or No)
What is Yes?
What does the break command do in a for loop?
It terminates the execution of a loop, usuallly after a certain condition is satisfied.
What does this code return?
int i = 0;
int[] n1 = {1, 4, 6, 5};
n1[2] = 8;
n1[1] = 6;
n1[0] = 7;
while (i < 4)
{
System.out.println(n1[i]);
i++;
}
What is the following:
7
6
8
5
After the following code runs, what is the value of n1[1]?
int n1[] = {3, 2, 1, 10};
n1[1] = n1[3] / n1[1];
A) 0
B) 1
C) 2
D) 5
What is D?
Where did Mr. Baun work before HH?
What is Manhattan Bagel?
What would the following code return?
int[] nums;
System.out.print(nums);
What is null?
When using a for loop, what is one correct way to set the maximum length that the loop will run through?
(Use int[] arr as the object for your answer)
for(int i = 0; (your code); i++)
What is (i <= arr.length - 1) OR (i < arr.length)
Jack wants to make an array that holds all of his books. Each value of the array would hold the title of a book.
There are two types of books, books that he owns and books that he got from the Horsham Library.
String books = new String{"book1", "Librarybook1", "Librarybook2", "book2"}
How could Jack change his library books in the array when he returns them?
books[index of library book] = (new book as a String)
double[] d1 = {2.0, 2.4, 2.5, 3.9, 10.0};
d1[3] = d1[4] - d1[3] * d1[0];
What is the value of d1[3] after this code runs?
A) 2.2
B) 2.4
C) 2.5
D) 3.9
What is A?
What is Mr. Baun's favorite fast food place?
What is Moe's Southwest Grill?