Fun-damentals
Let Me Ask You a Question
One More Time
Strings and Things
100
The error in this code:
int x = 2.0;
What is a data type mismatch?
100
The mistake here:

...
if (x = 1) {
    y++;
}

What is an example of using = instead of ==?
100
The output of the following program:

int n = 0
while (n < 10) {
     System.out.print(n + " ");
     n++
}

What is 0 1 2 3 4 5 6 7 8 9 ?
100
Initializing a String variable s with "chicken".
What is: String s = "chicken";
200
The value of this expression:
5 / 3
What is 1?
200
The simpler way to write (assuming b is a boolean):
b == false
What is !b
200
The output of the following program:

int n = 0
while (n < 10) {
     System.out.print(n + " ");
}

What is 0 0 0 0 0 0 0 0 0 0....?
200
The value of s4:

String s1 = "1";
String s2 = "2";
String s3 = "3";
String s4 = s1 + s2 + s3;

What is "123"?
300
The value of x:

double dub = 10*Math.PI;
int x = (int) dub;

What is 31?
300
The output of the following program if temp = 30

String report; if (temp < 30) {
    System.out.println("It's cold!");
} else if (temp < 10 {
     System.out.println("It's really cold!");
} else {
     System.out.println("It's fine);
}

What is "It's fine"?
300
The for loop equivalent of:

int n = 0
while (n < 10) {
     System.out.print(n + " ");
    n++
}

What is
The output of the following program:

for (int i = 0; i < 10; i++) {
     System.out.println(i)
}

300
The value of s2 after the following:

String s1 = "java is fun";
String s2 = s1.substring(0,3);

What is "jav"?
400
The error here:

final int BOTTLES = 6;
BOTTLES++;

What is an example of modifying a constant?
400
The value of letterGrade if grade = 99:

String letterGrade = " F";
if ( grade >= 90) { letterGrade = " A"; }
if ( grade >= 80) { letterGrade = " B"; }
if ( grade >= 70) { letterGrade = " C"; }
if ( grade >= 60) { letterGrade = " D"; }

What is "D"
400
A code snippet that tells you if an integer n is prime.
What is

int f = 2;
boolean isPrime = true;
while (!isPrime && f < n) {
     isPrime = (n % f == 0);
     f++;
}

400
The output of the following program:

String name = "Jane";
if (name.toLowerCase() == "jane") {
     System.out.println("You're Jane!");
} else {
    System.out.println("Not Jane!");
}

What is "Not Jane!"?
500
The value of y after this code executes:

int x = 4;
double y = x / 8;

What is 0?
500
The simpler way to write (assuming b is a boolean and n an integer):

if ( n == 0) {
     b = true;
} else {
     b = false;
}

What is b = (n == 0)?
500
A program that calculates the sum of the even integers between 0 and n.
What is

int total = 0;
for (int i < 0; i < n; i = i + 2) {
     total = total + i;
}

500
The correct way to compare strings s1 and s2
What is s1.equals(s2)?
M
e
n
u