Hi, I need help with Part 2 for my program. My code is below the question. Question Part 2:  The user (customer) can now view the e-list to select items for purchase. They should be able to select the items by entering the corresponding number from the list. Again, invalid selections should be handled with suitable error messages and the list should be repeated (see sample outputs below). Once the customer has selected a product, the program should ask how many of that product the customer would like to buy. Your program must make sure that selected products are available in stock, otherwise it should generate error messages and the menu should be repeated. After every valid selection is made, the current total should be printed, and the stock should be updated on the e-list (see sample outputs below). When the user completes product selection (i.e., enters 4), it should provide the user with their receipt. The receipt must show (a) the subtotal, (b) tax amount (13% of the subtotal) and (c) the total cost of the purchase. See sample outputs below. My current code: owner_name = input("Please enter your name >>") print(f"Hi {owner_name},") company_name = input("please enter your company name >>") print(f"{company_name} Let's setup a sales menu for '{company_name}'.") item1 = input("Enter item 1's name >>") item1_price = (input("Enter item 1's unit price >>")) item1_quantity = int(input("Enter item 1's quantity >>")) item2 = input("Enter item 2's name >>") item2_price = float(input("Enter item 2's unit price >>")) item2_quantity = int(input("Enter item 2's quantity >>")) item3 = input("Enter item 3's name >>") item3_price = float(input("Enter item 3's unit price >>")) item3_quantity = int(input("Enter item 3's quantity >>")) print(f"Great! Here is the e-list for {company_name}") print(""" ------------------ Welcome ------------------ =============================================""") print(f""" Please select the item you want to buy from the following menu: 1. {item1} (${item1_price} each), {item1_quantity} available 2. {item2} (${item2_price} each), {item2_quantity} available 3. {item3} (${item3_price} each), {item3_quantity} available Press 4 when you are done!""") Hint: Use while loop, if item1_price.isnumeric() != True: print("Price must be a number") elif float(item1_price) < 1: print("Price must be positive")

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hi, I need help with Part 2 for my program. My code is below the question.

Question Part 2:  The user (customer) can now view the e-list to select items for purchase. They should be able to select the items by entering the corresponding number from the list.

Again, invalid selections should be handled with suitable error messages and the list should be repeated (see sample outputs below). Once the customer has selected a product, the program should ask how many of that product the customer would like to buy. Your program must make sure that selected products are available in stock, otherwise it should generate error messages and the menu should be repeated.

After every valid selection is made, the current total should be printed, and the stock should be updated on the e-list (see sample outputs below). When the user completes product selection (i.e., enters 4), it should provide the user with their receipt. The receipt must show (a) the subtotal, (b) tax amount (13% of the subtotal) and (c) the total cost of the purchase. See sample outputs below.

My current code:

owner_name = input("Please enter your name >>")

print(f"Hi {owner_name},")

company_name = input("please enter your company name >>")

print(f"{company_name} Let's setup a sales menu for '{company_name}'.")

item1 = input("Enter item 1's name >>")

item1_price = (input("Enter item 1's unit price >>"))

item1_quantity = int(input("Enter item 1's quantity >>"))

item2 = input("Enter item 2's name >>")

item2_price = float(input("Enter item 2's unit price >>"))

item2_quantity = int(input("Enter item 2's quantity >>"))

item3 = input("Enter item 3's name >>")

item3_price = float(input("Enter item 3's unit price >>"))

item3_quantity = int(input("Enter item 3's quantity >>"))

print(f"Great! Here is the e-list for {company_name}")

print(""" ------------------ Welcome ------------------ =============================================""") print(f""" Please select the item you want to buy from the following menu:

1. {item1} (${item1_price} each), {item1_quantity} available

2. {item2} (${item2_price} each), {item2_quantity} available

3. {item3} (${item3_price} each), {item3_quantity} available

Press 4 when you are done!""")

Hint: Use while loop,

if item1_price.isnumeric() != True:
print("Price must be a number")
elif float(item1_price) < 1:
print("Price must be positive")

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY