Question: Hello, For background information, let me list the assignment. Develop a C++ program, following the logic in your flowchart, to read the name, taxable status,
Hello,
For background information, let me list the assignment.
Develop a C++ program, following the logic in your flowchart, to read the name, taxable status, and price of an indeterminate number of items from a file, calculate the taxes due and the sum of their prices and the taxes, and then display a carefully-formatted receipt.
All input values must be validated, and invalid values must be replaced with pre-determined defaults. Also, input failures must be handled so that the program does not crash. The default price for an item should be $0.0; the default taxable status should be Y, and the default name should be Unknown.
Calculation of taxes due is based on the taxable status of each item. Only those items whose taxable status is Y can be included in the tax calculations. Items whose taxable status is N are not taxable and not included in the tax calculations.
Use a tax rate of 8.5% for this assignment.
Format the receipt as follows:

The data file provided is a txt file and has the information listed as follows:
Bread 2.49 Y Milk 1.89 N Eggs, dozen 0.97 N Apples 4.75 Y Bananas 1.69 Y Peanut Butter 2.49 Y
So, I am able to pull the file into my program, but I am having a very difficult time with the formatting and with the logic. Any tips or code examples?
Thank you for shopping at StuffMart Item Price Tax Bread Milk Eggs, dozen Apples 2.49 Y 1.89 Y 0.97 Y 4.75 N Subtotal (8.5%) Total $ 10.10 Tax 0.45 10.55
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
