Examlex

Solved

Assertions
for Each of the Five Points Labeled by Comments

question 3

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 randomWalk(int steps) {
Random rand = new Random();
int x = 0;
int r = rand.nextInt(2);
// Point A
while (steps > 0 || x == 0) {
// Point B
if (r == 0) {
x++;
// Point C
} else {
x = 0;
// Point D
}
steps--;
r = rand.nextInt(2);
}
// Point E
return x;
}
Fill in each box below with one of ALWAYS, NEVER or SOMETIMES. (You may abbreviate them as A, N, or S.)
 steps >0x>0r>0 Point A  Point B  Point C  Point D  Point E \begin{array}{l|c|c|c|} & \text { steps }>0 & \mathrm{x}>0 & \mathrm{r}>0 \\\hline \text { Point A } & & & \\\hline \text { Point B } & & & \\\hline \text { Point C } & & & \\\hline \text { Point D } & & & \\\hline \text { Point E } & & & \\\hline\end{array}


Definitions:

Research Report

A document presenting the methodology, findings, and conclusions of a research project.

Research Reports

Documents that present the methodology, findings, and conclusions of a research project.

Dissertations

Comprehensive academic papers that are typically a requirement for a doctoral degree, presenting original research or findings on a specific subject.

Hypotheses

Proposed explanations or predictions, based on limited evidence, that serve as a starting point for further investigation.

Related Questions