Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program ( q 1 . py ) that produces a grocery store checkout receipt. Because we have not learned about loops yet we
Write a program qpy that produces a grocery store checkout receipt. Because we have not learned about loops yet we will limit ourselves to exactly items so imagine that your software is running on a checkout counter that says items only Prompt the user for items. The user will enter three things for each item separated by spaces.
Name of the item
Price per unit
Quantity
For example: input apples mean item name is apples price per unit is $lb and lb apples are purchased.
You must accept the user input and store it in a dictionary. The keys for the dictionary will be and and the value will be tuples. For example, the tuple for the item entered above is apples
Print the dictionary after all items are added. You should be able to do this by passing the constructed dictionary to the print function. Then print the receipt in the format shown below. You will need format control strings for this. You need to calculate the required totals. The field sizes are and
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