Essay
Assertions
For each of the five points labeled by comments, identify each of the assertions in the table below as either being always true, never true, or sometimes true / sometimes false.
public static int mystery(int a) {
int b = 0;
int c = 0;
// Point A
while (a != 0) {
// Point B
c = a % 10;
if (c % 2 == 0) {
b++;
} else {
b = 0;
// Point C
}
a = a / 10;
// Point D
}
// Point E
return b;
}
Fill in each box of the table below with one of the following words: ALWAYS, NEVER or SOMETIMES.
(You may abbreviate these choices as A, N, and S.)
Correct Answer:

Verified
Correct Answer:
Verified
Q1: While Loop Simulation<br>For each call below
Q2: Programming<br>Write a static method named graduation
Q3: Parameter Mystery<br>At the bottom of the page,
Q5: Programming<br>Write a static method named randomRects
Q6: Expressions<br>For each expression in the left-hand
Q7: Programming<br>Write a static method named cheerleader that
Q8: If/Else Simulation<br>For each call below to