CS 1401, Quiz #10, version a

Date: Tuesday, November 15, 2005
Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. Use the ? construction to assign to the Boolean variable cheap the value "true" is cost is below 25 and "false" if cost is 25 or above.





















2. What is printed by the following code fragment? Trace your results, do not just guess.
for (savings = 0, salary = 20; salary > 0; savings += 5, salary -=5)  
  System.out.println(savings + " " + salary);