Homework, as usual.
This time it's the semester project. Take a gander at how easy this is.
OVERVIEW
This project will simulate a shopping excursion at a local supermarket. You must create a customer who will then proceed to go shopping for 5 to 10 items. The program will prompt the user to enter the number of items to buy. Once the program has determined how many items the customer will buy, the shopping spree will take place. Your program should choose the items randomly from the master list given as input. After the items have been picked, the checkout process will begin, and finally a receipt printed. Your program should then ask if the user wants to go shopping again or not. If yes, recycle the program. If no, quit the program. You should go to one of the local supermarkets and get a receipt. The program receipt should simulate the one you obtain from the supermarket.
INPUT
A file of inventory in the following format: code | description | price. The code will be a 4 digit unsigned, the description will be a string (spaces and special characters are allowed), and the price will be a float with 2 digits after the decimal. The file is available under the Downloads link.
OUTPUT
A simulated receipt printed on the screen. The receipt should be properly formatted according to the sample you get from your favorite supermarket.
PROGRAM FLOW
When executed, your program should do the following.
Display a greeting then prompt for a keypress.
Display a menu (Shop, exit).
Display a receipt if the user chooses to shop, then prompt for a keypress.
Recycle the menu.
PROGRAM DETAILS
The customer will purchase between 5 and 10 items.
Prices for items listed on a poundage basis are per pound. For example, the price of apples is $1.09/pound.
When selecting an item that is priced by the pound, you must generate a purchase of 1 to 3 pounds (your random generator).
Multiple purchases of the same item are allowed.
There is no limit to the stock.
The customer will have $50 to purchase groceries.
When a file error is detected, clear the stream, output an appropriate message, and exit gracefully. For example, here are some messages you might consider.
We will be closed for inventory
We will be closed for remodeling.
A correctly formatted receipt is an essential part of your grade, so be sure and save one from a local supermarket to use as a model.
I've already got the vectors to store all the inventory information, I got them filled with the proper information (and datatype), and I've got all the functions in place to draw the receipt. This was after an hour of tapping away at the keyboard.
I fucking love easy homework.