Spring 2006 - Programming Project 1, Part A
30 points
Out: February 16, 2006
Due: February 23, 2006
Reminder: Programming projects are larger programs that use multiple techniques that we have studied, therefore they contribute a much higher percentage of the final grade than programming assignments.
Part A of this first programming project consists of analyzing
and designing a program for the problem statement given below. The analysis and design must be entirely your own work, except for
any help you may get from the instructor. Hand in a clean, readable
copy of your analysis and design to the instructor by 5pm on Thursday,
February 23.
Part B of this project will be to implement your program with
certain implementation criteria. This portion will be handed out on
Thursday, February 23, and will be due the Thursday after spring
break, March 16.
A soft drink distributor asks you to write a menu-driven program to keep track of their inventory of cases of soft drinks. The distributor sells the following brands with the indicated product codes:
| Brand | Product Code |
| Coca-Cola | 1 |
| Pepsi | 2 |
| Canada Dry | 3 |
| 7Up | 4 |
| A&W | 5 |
Your design should consist of analyses and designs for the
main program and any functions you use. The action taken for
each choice in the menu (i.e., purchase, sell, display) must be
designed as a function. Other parts of your program may also be
designed as functions. The goal is to produce a modular design where
each function is understandable in its own right.
Welcome to the Evansville Distributorship Inventory Program. This program keeps track of soft drink inventories. Please enter the beginning inventory for the following brands: Coca-Cola: 20 Pepsi: 30 Canada Dry: 10 7Up: 10 A&W: 5 You may choose an action from the following menu: P: Purchase soda S: Sell soda D: Display inventory What is your selection?: D Soda Cases ------------------ Coca-Cola 20 Pepsi 30 Canada Dry 10 7Up 10 A&W 5 Do you want to do another action? (y/n): y You may choose from the following menu: P: Purchase soda S: Sell soda D: Display inventory What is your selection?: P You may choose from the following soda brands: 1: Coca-Cola 2: Pepsi 3: Canada Dry 4: 7Up 5: A&W Please enter the code for the soda you are purchasing: 1 Please enter the number of cases purchased: 10 10 cases of Coca-Cola have been added into the inventory Do you want to do another action? (y/n): n The final inventory is: Soda Cases ------------------ Coca-Cola 30 Pepsi 30 Canada Dry 10 7Up 10 A&W 5 Have a good day!