which one of the following invariants for count is correct just prior to the loop test?
a. 1< count < 20
b. 3< count < 20
c. 2< count < 20
d. 3< count < 21
e. 3< count < 21
Programming Warm-Up Exercises
1. Write a Switch statement that does the following:
If the value of grade is
A, add 4 to sum B, add 3 to sum C, add 2 to sum D, add 1 to sum F, print Student is on probation
2. Modify the code for Exercise 1 so that an error message is printed if grade does not equal one of the five possible grades.
3. Rewrite the Day function of Chapter 8 (pages 406408), replacing the If-Then-Else-If structure with a Switch statement.
4. Write a program segment that reads and sums until it has summed 10 data values or until a negative value is read, whichever comes first. Use a Do-While loop for your solution.
5. Rewrite the following code segment using a Do-While loop instead of a While loop.