// 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 import java.util.*; public class Assertions2 { public static int mystery(Scanner console) { int y = 0; int z = 1; int next = console.nextInt(); // Point A while (next >= 0) { // Point B if (y > z) { // Point C z = y; } y++; next = console.nextInt(); // Point D } // Point E return z; } } /* next < 0 y > z y == 0 Point A S N A Point B N S S Point C N A N Point D S S N Point E A S S */