Professional Documents
Culture Documents
c) if (y < 100) {
y += 2;
}
3. a) The first blank should be even, the second blank should be odd.
b) x = (num % 2);
switch (x) {
case 0: System.out.println("even number"); break;
default: System.out.println("odd number"); break;
}
5. An appropriate message will not be displayed if the age value is 18 or 65. The second
condition should be rewritten as (age >= 18 && age <= 65).
6. a) True.
b) False.
c) True.
d) True.
e) True.
f) True.
g) True.