Question: Flowchart and code a C++ program that takes as input data a purchase price between 1.0 and 10000.0 dollars, and a tax code of either
Flowchart and code a C++ program that takes as input data a purchase price between 1.0 and 10000.0 dollars, and a tax code of either G (for GST ONLY goods) or P ( for GST and PST goods) or N (for NO TAX goods).
For each purchase made the program will print the purchase price, the amount of sales tax on that purchase to the nearest cent, (sales tax is 5% for GST goods or 12% for GST and PST goods or 0% for NO TAX goods) and the full amount paid ( this is equal to purchase price plus sales tax).
Purchases should be read into the program until end-of-file (EOF) is reached.
After all purchases have been processed, the program will print a summary showing the total purchase, the total tax paid and the total amount of the bill (total purchase price plus total tax paid).
Error checks should be performed on all input data. Check purchase price and code to make sure they are within the proper range and values.
Draw a storage layout for all variables used in your program. The starting value of any initialized variable should be shown in the storage layout. (Put in the correct value inside the box.) Variables with no initial values should be filled with a '?'.
Note that there are three major sections of the program. One is the initialization and declaration (or beginning of the program). One is the main loop and the other is the ending of the program where you print out the totals.
Use the sample input as your input data. Make sure that there is at least ONE blank between purchase price and tax code.
Please check your answers with the sample output shown below.
Sample Input:
35.4 G
10000.0 P
10001.3 P
355.4 G
25.5 P
77.25 N
899.5 P
63.5 A
67.8 N


Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
