Question
Have you ever been low on cash and couldnt go beyond a certain dollar limit when shopping? You sort of need a calculator in your
Have you ever been low on cash and couldnt go beyond a certain dollar limit when shopping? You sort of need a calculator in your head. It would be cool if a device was actually part of the cart and as you add an item into the cart it would increment your total counter. To solve this, we are going to write a program that keeps a tally of the amount that we have spent so far as we visit a store. What Your Program Should Do: 1. Allow the shopper (user) to enter in the product name and the cost. This should be echoed and confirmed. Make sure to check for bad data.
2. The user should be allowed to continue this until they want to check out.
3. Your program needs to keep a running total.
4. Upon checkout, the grand total should be displayed. 5. Display money using proper formatting.
You will need to have the following before displaying dollars and cents: cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); cout.precision(2);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started