Text: 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(Scanner console, int f) {
int num = console.nextInt();
int h = 0; // Point A
while (f < s) { // Point B
if (num == 0) {
f = h;
f++; // Point C
} else { // Point D
h++;
}
num = console.nextInt(); // Point E
}
return f;
}
Fill in each table cell below with one of ALWAYS, NEVER or SOMETIMES. You may abbreviate them as A, N, or S.
h == 0 - Point A: S
f >= 5: N
num == 0: S
Point B: S
Point C: S
Point D: S
Point E: S
2