Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

total_before, tax_total, total = 0,0,0 while True: while True: try: item_no = int(input('Enter item number(Enter 0 to end): ')) if item_no != 0 and item_no499:

image text in transcribed

total_before, tax_total, total = 0,0,0 while True: while True: try: item_no = int(input('Enter item number(Enter 0 to end): ')) if item_no != 0 and item_no499: raise ValueError break except: print("Enter item number between 100 to 499.") if item_no == 0: break while True: try: quantity = int(input('Enter quantity: ')) break except: print("Enter valid quantity.") while True: try: unit_price = float(input('Enter per unit price: ')) break except: print('Enter valid unit price.') if item_no>=100 and item_no=400 and item_no=300 and item_no=200 and item_no 

Output:

image text in transcribed

This is what I did part 1

please do part 2

python programming

Assignment 1 Part 1 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 Item Numbers Sales Tax Rate 0 5% 7% 12% 100 199 200 299 300-399 400-499 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 Total Tax 125.00 Subtotal Plus Tax 1125.00 NOTE 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 Validate your inputs when necessary, display an error message and try to get a new input in case an invalid input has entered. 1. 2. Part 2 Modify your program in Part 1 to produce the above-mentioned report for 100 customers. Enter item number(Enter 0 to end) 101 Enter quantity: 2 Enter per unit price: 100 Enter item number(Enter 0 to end): 201 Enter quantity: 2 Enter per unit price: 100 Enter item number(Enter 0 to end) 301 Enter quantity: 2 Enter per unit price: 100 Enter item number(Enter 0 to end) 401 Enter quantity: 2 Enter per unit price: 100 Enter item number(Enter 0 to end) 0 Subtotal before tax 800.00 Total 48.00 Subtotal Plus Tax 848.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

Carry out an interview and review its success.

Answered: 1 week ago