Solved

Assertions
for the Following Method, Identify Each of the Three

Question 3

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 assertions(int n) {
int x = 2;
// Point A
while (x < n) {
// Point B
if (n % x == 0) {
n = n / x;
x = 2;
// Point C
} else {
x++;
// Point D
}
}
// Point E
return n;
}
x>2x<nn%×0==0 Point A Point B Point C  Point D  Point E \begin{array}{|c|c|c|c|} \hline& x>2 & x<\mathrm{n} & \mathrm{n} \% \times 0==0 \\\hline \text { Point } A & & & \\\hline \text { Point } \mathrm{B} & & & \\\hline \text { Point C } & & & \\\hline \text { Point D } & & & \\\hline \text { Point E } & & & \\\hline\end{array}

Correct Answer:

verifed

Verified

Related Questions