This is the same cashier problem i posted but our professor included filestream problem. here's the question:
Cashier 1.0 is a C++ program that displays on the screen item codes with corresponding item description and price (at least 10 items). It asks the user to enter the code of the item purchased by a customer. It looks for a match of the code entered in the text file, items.txt. Then, its description and price are displayed on the screen too. Also, it asks for the quantity of the particular item code entered. It displays its subtotal thereafter. Moreover, it keeps on accepting item codes until ‘0’ is pressed. Consequently, it displays the total amount due. Then, it asks the user to tender the amount of cash of the customer. It displays the change and its breakdown. Finally, it sends the total amount due, amount tendered and the change to an output file, checkout.txt.
• The program should inform the user if the file, items.txt, does not exist. • The program should not accept item codes that are not available.
• It should not accept quantity less than or equal to 0 and must keep on asking for a valid quantity.
• It should not accept amount of cash less than the amount due and must continue asking for a valid amount.
• It should ask the user if he/she wants another transaction.
I've done everything except for the checkout.txt part and the items.txt part.
here's my code: