Identify the various assertions in the following code as being always true, never true, or sometimes true

Question:

Identify the various assertions in the following code as being always true, never true, or sometimes true and sometimes false at various points in program execution. The comments indicate the points of interest:

public static int mystery (int n) { Random r = new Random (); int a = r.nextInt (3) + 1; int b = 2; // Point A while (n > b) { // Point B b = b + a; !! if (a > 1) { n--; // Point C

Categorize each assertion at each point with ALWAYS, NEVER, or SOMETIMES.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: