IUP Computer Science
COSC 300    Spring 2002

Project #3
(Due  15 March 2002)


Mrs Singer's Girl Scouts (Troop 43) have just finished the annual cookie sale.  You are to write a program to help Mrs Singer determine the most boxes of cookies that anyone sold and the fewest boxes that anyone sold this year.  The program must also make a neat listing of the girl's names and the number of boxes they sold.  This is to be an interactive program so that Mrs Singer can enter the names and box counts at the keyboard.

Your program should repeatedly prompt Mrs Singer for a girl scout's name and the number of boxes of cookies which that she sold.  Mrs Singer will enter only the girl's first name with no leading or trailing blanks.  Your program must collect the name and count information.  When Mrs Singer indicates that there are no more girls, your program must display the fewest number of boxes that any scout sold, the most number of boxes that anyone sold, and the total number of boxes sold by all scouts in Troop 43.  Then, the program should list the names and amounts sold for each Girl Scout in a neat table so that the names and numbers line up - this listing must be in reverse order from the order in which the names were entered.

Notes:  Each Girl Scout must sell at least 10 boxes of cookies, even if her parents have to buy them.  No one from Troop 43 has ever sold more than 64 boxes during the sale.  There are fewer than 25 girls in Troop 43.  Mrs Singer indicates that there are no more girls by pressing Enter alone when asked for another girl's name.  The girls' first names are not more than 15 characters long and all consist of a single word (no two-part names like Mary Ann or Rose Marie).

Hand in a printout of your well commented program (the .LST file).  Also, hand in a printout of the captured output from an execution of the program, one similar to the sample shown following.  Finally, rename the source file to something involving your name and copy it to the hand-in folder for your section on the P drive.

Below is a sample execution showing very simple prompts and output labels for results.  But it should give you the idea of what is wanted.  Keyboard input is shown in bold.

Scout's name: Mary
Boxes sold: 23
Scout's name: Ginger
Boxes sold: 11
Scout's name: Cindy
Boxes sold: 30
Scout's name: Elizabeth
Boxes sold: 28
Scout's name:

Troop 43 Sales Report

Fewest sold: 11

Most sold:   30

Total sold:  92

Elizabeth      28
Cindy          30
Ginger         11
Mary           23
 

Extra Credit:
Instead of displaying the names and boxes sold in the reverse order in which they were entered, display the list sorted based on the number of boxes sold.  This is not an easy extra credit.