CSC 157        Assignment 4 – Repetition using while                 100 points
 

Assigned: 02/07/2001

Due: 02/14/2001 at the start of class

Pre-Lab (Do Before Lab): Bring an empty (or nearly empty) disk (keep any .c files you create, but other files can be deleted). Plan out sequence of statements needed for program.

 

Main Assignment: 
        We are writing a program for Mail Orders R Us (MORU). They have started their operations with one product: zip disks priced at $6.95. MORU also offers customers a 10% discount for ordering 10 or more zip disks. Our program is going to calculate customer costs, and also print a daily summary report. Your program will operate as shown below. It will request the number of customers, then loop through that many customers, getting the number of zip disks ordered. To keep your job simpler, we will assume that the order-entry typists are infallible (thus don't re-prompt the user for correct data -- I MEAN IT, DON'T ADD THE EXTRA CAPABILITY, at least not in the version you hand in). Your program will display for each customer the number of zip disks ordered and the total cost. The program should also print (in a report at the end) 1) the total number of zip disks sold, 2) the number sold at a discount, and 3) the total revenues for zip disks.
 

Sample interaction with the user:

 
How many customers will be handled this time? 3
 
Please enter the number of zip disks ordered by customer   1: 10
 
Customer:   1    #Zips:  10   Cost:   62.55
                
Please enter the number of zip disks ordered by customer   2: 5
 
Customer:   2    #Zips:   5   Cost:   34.75
 
Please enter the number of zip disks ordered by customer   3: 15
 
Customer:   3    #Zips:  15   Cost:   93.83
 
Summary Data:
-------------
   Number of Zip Disks:                30          
   Number of Zip Disks Discounted:     25          
   Revenues from Zip Disks:        191.13 

 

Hand-in:

     1) Listing of the program

     2) Disk with  .c source file plus .exe executable file.

NAME YOUR PROGRAM FILE yourlastname4.c

 

Miscellaneous:

1.        Make your program work like shown above. If you have any questions about what should be done, please ask!! Have the user enter the data as shown above!  (e.g. Don’t reverse questions). You can assume that there will always be at least one customer.

2.        MAKE SURE YOUR PROGRAM WORKS! (i.e. more than just removing compile errors). You can test your program on the above example, but make sure you test it on other data as well - I will! Your program needs to be able to handle any valid inputs.

3.    Remember: Indentation, meaningful variable names, symbolic constants, and meaningful comments. Weaknesses in any of these could result in points off. You MUST include comments that explain your program in order to get full credit. Also, make sure you put YOUR NAME, section, and e-mail address in comments at the beginning of the program.