What is FAFSA?
Application for federal student aid.
Any for loop can be written as a while loop, T/F?
true
Declare an integer variable called "a" and initialize it to 5.
int a = 5;
the modulus operator
%
0
How many years has Jess been in his doctoral program?
4 going on 5.
Make the following into a for loop:
int i = 0;while (i < 10) {// codei++;}
for (int i = 0; i < 10; i++) {
// code
}
You can call methods on a String variable, T/F?
true
How to test if a number is even?
number % 2 == 0
How do you iterate through a 2D array?
Two nested for loops
Cristiano Ronaldo
What is the syntax to declare a while loop that runs forever?
while (true) {
}
How do you print an array variable?
Iterate through it in a for loop, printing element by element
What is the difference between = and ==?
= is for assignment, == is for equality testing
How to reference the element at the 3rd row, 1st column of a 2D array?
array[2][0]
What is the number one most streamed song on Spotify?
Blinding Lights by the Weeknd
Keyword that allows you to immediately halt execution of a loop
break
You can call methods on an int variable, T/F?
false
How to test two Strings for equality
.equals()
Declare and initialize a variable named "w" that is a new 2D array of Strings, with 4 rows and 5 columns.
String[][] w = new String[4][5];
What is the busiest airport in the world?
Hartsfield-Jackson Atlanta International Airport
What is the sum after the loop runs?
int sum = 0;
for (int i = 0; i < 4; i++){
sum += i;
}
Name at least 2 problems with the following code that tries to declare an initialize a new 2D array of ints:
int[][] = q_array new String[4];
int vs String, 2D vs 1D, = in wrong place
What two things can the + operator do?
add two numbers, concatenate two Strings
Accessing array[5] in an array of length 5 results in ...
an out of bounds exception