// Zorah Fung, CSE 142 // An example of an "assertions" problem that will appear on the midterm // At each point, we want to logically reason about the state of our code public class Assertions { public static void mystery(int x, int y) { int z = 0; // Point A while (x >= y) { // Point B x = x - y; z++; if (x != y) { // Point C z = z * 2; } // Point D } // Point E System.out.println(z); } } /* x < y x == y z == 0 Point A SOMETIMES SOMETIMES ALWAYS Point B N S S Point C S N N Point D S S N Point E A N S */