Solve exercise 4 from section 6.9. The loop for multiple test scores should be a yes/no style loop. When this loop is done, please print the number of test scores processed (otherwise, why did we count them? *grin*).
(You do not need to do the optional part.)
Use PROCs well to break your program into re-usable parts. (You should understand the value of modularization by this stage in your programming course-work/career, right? It will also serve you well when we learn to make our own 'link libraries'.)
This assignment is Level 3.
Add (Level 1.5) to allow the user to enter the whole word ("yes" or "no") to your multiple scores loop. (Hint: What does ReadChar return when it reads a new-line?)
Perhaps a general module to clear the input buffer up to and including a specified character would be useful? Can you default the terminal character to a new-line for your caller? That would be so nice! Thanks...
Okay, okay! So if you have the termination character 'argument' to your PROC default to a new-line, you can add an extra (Level 1). Hint: What is the single character that cannot be typed at the keyboard (not even with the ALT-keypad trick)?
Add (Level 0.5) to alter the 'range checking' so that any score over 100 simply gets an A+ rather than an error message. (Note that this makes the 'letter' grade be a 'string'!)
Add (Level 1.5) to add another loop to repeat the test scores loop until the user has no more sections to enter. (Here we assume that the scores loop was for all the scores in a particular section the professor teaches.)
This loop for more sections should be a yes/no style loop, as well. You can reuse your 'whole word' option PROC here for an additional (Level 0.5).