CS 1401, Quiz 5, MW class section

Date: Monday, September 29, 2014
Name (please type legibly, ideally in block letters): ______________________________________________________________________

1. Mark what is covered (Y) and what is not covered (N) in the part of the book that you were supposed to read for this week:

2. For each of the following two pieces of code, write an equivalent code by using if-then statements:

+double a = (1 <= a && a <= 2) ? a - 1 : 0.

switch(a){
  case 0: a++;
    break;
  case 1: a--;
    break;
  default: a = a + 2;
}