Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dear Chegg experts, I am in need of your help! Please answer this question in 45 minutes. I will be sure to upvote your answer.

Dear Chegg experts, I am in need of your help! Please answer this question in 45 minutes. I will be sure to upvote your answer. Please prioritize this question over any other.

image text in transcribed

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) Include the line "from pprint import pprint" in the top of your program] Input Format: Name of first item Quantity of first item Output Format: Items ordered by the customer and their unit price as a dictionary Total Bill amount For example: Test Input Result 1 d 2. {'a': 140, 'd': 400} 1220 2 a 3 # N 2 B MODEL NOT AVAILABLE {'a': 140} 280 #

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago