Instantiation
Traversal
Array vs ArrayList Methods
Solving
Baun Trivia (Secret)
100

What do you have to put after the type (primitive or String) to make an array?

What are brackets ([])

100

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?

100

How do you change a value in an array?

What is (array name)[array index] = (new value)?

100

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?

100

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

200

Define an array.

What is an object that stores multiple values in a single "container"? The values have to be of the same type.

200

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]);)?

200

Can you use .remove() with arrays (not ArrayLists)?

What is No?

200

String[] names = {"Jack", "Michael", "Baun"};

What is the index of the String "Baun"?

A) 0

B) 1

C) 2

D) 3

What is C?

200

Has Mr. Baun run a marathon? (True or False)

Extremely True

300

How do you instantiate a blank array of a set size?

What is (int[] n1 = new int[number];)?

300

What is the format for an enhanced for loop?

(use int[] arr in your signature)

What is: (for(int n : arr))?


300

Is .add() an Array method, an ArrayList method, both, or neither?

What is an ArrayList method?

300

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?

300

What did Mr. Baun major in?

What is Education?

400

Can you make a boolean array? (Yes or No)

What is Yes?

400

What does the break command do in a for loop?

It terminates the execution of a loop, usuallly after a certain condition is satisfied.

400

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


400

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?

400

Where did Mr. Baun work before HH?

What is Manhattan Bagel?

500

What would the following code return?

int[] nums;

System.out.print(nums);

What is null?

500

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)

500

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)

500

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?

500

What is Mr. Baun's favorite fast food place?

What is Moe's Southwest Grill?

M
e
n
u