Solved

Assertions
for the Following Method, Identify Each of the Three

Question 7

Essay

Assertions
For the following method, identify each of the three assertions in the table below as being either ALWAYS true, NEVER true or SOMETIMES true / sometimes false at each labeled point in the code. (You may abbreviate these choices as A/N/S respectively.)
public static int mystery(int x) {
int y = 1;
int z = 0;
// Point A
while (y <= x) {
// Point B
y = y * 10;
z++;
// Point C
}
// Point D
z--;
// Point E
return z;
}
y>xz<0z>0 Point A  Point B  Point C  Point D  Point E \begin{array}{|c|c|c|c|} \hline& \mathrm{y}>\mathrm{x} & z<0 & z>0 \\\hline \text { Point A } & & & \\\hline \text { Point B } & & & \\\hline \text { Point C } & & & \\\hline \text { Point D } & & & \\\hline \text { Point E } & & & \\\hline\end{array}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions