Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In an electronic shop, X number of brands are available namely 'a', 'b', 'c','d', 'e'. Unit price of the brands of X are 140, 200,

image text in transcribed

In an electronic shop, X number of brands are available namely 'a', 'b', 'c','d', 'e'. Unit price of the brands of X are 140, 200, 180, 400 and 300 respectively and the available stock in hand is 10 for a, 100 for b,50 for c, 4 for d, and 2 for e. A customer can enter the name of the brand of X he wants to purchase and the required quantity.Write the Python code to keep track of total bill amount. The program should keep asking for new items until nothing is entered (no input followed by enter/return key). The program should display the total amount. The brand name entered by the customer should be made case in sensitive and if the user enters quantity greater than stock in hand then print "QUANTITY INSUFFICIENT". If the brand entered by the user is not in the shop then print "MODEL NOT AVAILABLE. But in both the cases compute cost for other items entered and continue getting new items. Print the items ordered by the customer in lower case and unit price of the item as a dictionary in sorted order and then the total cost to be paid by the customer. Syntax for pprint is pprint(dictionary name)

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago