Description
Feed Store Inventory
Write a program that stores the following information about products at a feed store in a structure:
Field Name |
Type |
item |
cstring |
qty (bags) |
int |
price (per bag) |
float/double |
This program will NOT use an array of structures. Instead, your program will store the data in a file named “feed.dat” and use a single structure variable to read/write a record as needed.
Your program must include an operations menu with the operations shown below:
1. Add an item.
2. Print the information for all items, in table form.
3. Purchase an item (read a full or partial name and quantity from the user, find the record, read it, update the quantity, write the updated record back over the original record)
4. Calculate and display the total value of the items on hand. (sum of qty * price for items)
Your program should allow the user to make selections until they choose a 5th option “Exit” which will end the program.
Use an enumerated type for the operations. Use the enumerators in a switch/case statement that calls a function to process each choice.
Your program should be modular. Use a separate function for each option stated above. Your output should be well-organized, neat, and easy to read.
Design your program by completing the CS 250 Program Design Document. Save the design in a file named IceCreamDesign_xxx.doc where xxx are your initials. Submit your program design in the Program 6 Design drop box by the beginning of the class preceding the program due date, as shown in the calendar and drop box tools.
Write your program. Save your program in a file named feed_store_xxx.cpp where xxx are your initials. Compile, run and test your program.
Update your Program Design Document. Update the structure chart & function descriptions to fit your working program. Update the time estimates based on actual time spent. Save the updated document.
Submit your final Program Design document and working .cpp file in the Program 6 drop box, by the date shown in the calendar and drop box tools.