The assignment was to develop a simple program that would calculate shipping costs for Bart and Jim's rock business. The program was to have two lines of input (rocks, zone) and two lines of output (regular and express shipping), and to run in an infinite loop.
Lots of students had a problem figuring out how to do an infinite loop. The easiest way is to use "while true do..." Typically you would have an "exit" or a "halt" statement within the loop, but in this case we just let the user type Ctrl-C at the end of the session.
The other common problem folks had was using two procedures to calculate the shipping cost, one for express, one for express charges. These procedures are very similar, and they use a lot of the same constants. So the best thing to do is write one procedure and use an "if" statement within it to control whether the output is regular or express cost. That means you need to have an input parameter that tells the procedure which cost to calculate. This kind of parameter, which can only take on a few values, is often called a "flag."
Click below for MY solution. Yours should be similar, but I don't expect it to be identical.