Question
Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of
Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of savings. This program should have a separate header (discount.h), implementation (discount.cpp) and application files (main.cpp). The program must also have user input: the user must be prompted to enter data (the original price, and the percent off as a percentage). There must also be a validation, for example:
Output: Enter the original price of the item
User input: 29
Output: Now enter the percent discount
User input: 0.10
Output: Please enter the discount as a percentage
Now the user input: 10
------------------
The user input should be stored within an object. Be sure to use mutators to assign values to Class Variables. Classes should also include functions which will manipulate/calculate data for the final result (both the calculated discount and the total savings). When the final results are calculated/processed, the program should store the final results (discounted price and savings) as a text file. The final result should also be accompanied with any context which should help a reader understand what the results mean (the original price of the item was user inputted price, with a user inputted percent discount, the new price of the item is calculated price! You saved amount of savings this much money!
Please leave \\comments and label where Discount.h, Discount.cpp, and main.cpp are, thanks.
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