Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that an imaginary supermarket sells items that are identified by a unique item number which is an integer in range 100 to 499
Assume that an imaginary supermarket sells items that are identified by a unique item number which is an integer in range 100 to 499 inclusive. The items are classified in four different categories based on their numbers, and each category defines a different sales tax rate. These four categories along with the range of item numbers included in them, and their specific sales tax rates have been summarized in the following table: Category A Item Numbers Sales Tax Rate 100-199 0 B 200-299 5% C 300-399 7% D 400-499 12% You are to write a program that reads the information of the items sold to a customer from keyboard (i.e. the item number, quantity, and unit price), calculates the invoice subtotal including the applicable taxes, and for example displays the following information on the screen: Subtotal Before Tax 1000.00 NOTE Total Tax 125.00 Subtotal Plus Tax 1125.00 1. Format your output to be printed organized like a table. To do so, try to set up an appropriate minimum field width, change the alignment of your outputs, and consider two digits of precision for your amounts. 2. Validate your inputs when necessary, display an error message and try to get a new input in case an invalid input has entered. Part 2 Modify your program in Part 1 to produce the above-mentioned report for 100 customers.
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