This assignment requires the development of C++ software that supports the activities of an imaginary on-line food service (i.e., software that simulates the selection and payment of food items over computer networks). Your on-line food service should be able to process the following basic actions.
• Addition of food items (by name and quantity) to a customer shopping cart.
• Removal of food items (by name and quantity) from a customer shopping cart.
• Report of items in customer shopping cart. (Created on demand and after checkout.)
• Payment for items in a customer shopping cart (i.e., customer checkout) with a credit card number.
• Addition of food item quantity to the inventory of the food service (i.e., re-stocking)
• Summary report of all previous food purchases. (Created on demand.)
Assumptions and Minimum Data Requirements:
You must use the following features or structures of the C++ programming language.
• Five (5) or more programmer-defined classes including at least one (1) instance of inheritance.
• At least one (1) use of polymorphism and at least one (1) use of composition.
• Initialization of class data must be performed in class constructors.
• Pointer data types, the C++ String class, and at least one instance of operator overloading.
• At least one use of a template from the standard template library.
• Exception handling must be implemented to validate user inputs.
• Customer, cart, and inventory data must be saved on disk and retrieved each time your program runs.
• Customer, re-stocking lists and “initial” inventory data should be pre-loaded into text files.
• All user input and output should be implemented with a simple text-based console window.
You must decide the best organization and classification (i.e., class definitions) of the following items to support your application processing. Other data definitions and structures may be added as necessary. These definitions are only suggestions – not mandatory requirements.
Customer: name or ID, credit card number, current shopping cart number
Food Item: food item name and current price
Cart: cart number, list of food item names with associated quantity and prices
Inventory: list of food items on hand with associated quantity
Credit Card: card number and remaining balance
Customers may request to see the contents of their shopping cart at any time. Upon request, you must display the following information (in any programmer-defined format). Also print this same report at checkout.
Customer name, cart number, and appropriate heading for cart report or checkout.
Itemized list of food items in the cart with:
• food item name;
• food item quantity;
• food item cost (i.e., per item cost); and
• total cost of all selections for this customer.
Summary of Food Purchases:
This is a report which summarizes all previous food purchases. Each time the report is requested, the following output should be produced:
• food items names;
• total quantity sold for each food item;
• total sales for each food item; and
• total of all sales for all food items.
Test Data and Error Messages:
Create your own test data for this assignment. Print an appropriate error message whenever requested quantity exceed supply (e.g., when customers ask for more food than current amount in inventory or when total cost of food at checkout exceeds balance on credit card). See following samples.
“Sorry. Not enough s for your selection. Request ignored.”
“Sorry. Checkout cancelled due to insufficient funds on credit card. Cart emptied and returned to store.”
You must insert numerous comments throughout the source code listings.
Required Items to be Submitted for Stages of Development:
Stage 1: Pictures of user screens (input prompts and sample outputs). UML class diagrams including inheritance.
Stage 2: Description of data files and illustration showing which class methods access each file.
Stage 3: Final tested version of program with documentation.