Question: Receipt Program Develop a Python program with List and Dictionary to create a receipt Program. Show the apple names and prices from dictionary ( hint:

Receipt Program
Develop a Python program with List and Dictionary to create a receipt Program.
Show the apple names and prices from dictionary (hint: use a for loop to go through the Dictionary)
User will make selection based on displayed apple information, save selected Apple Name, Price, Lbs, calculate subtotal to the list.
Create a loop to go through the list, display the items with item name, price, weight, subtotal and Total amount.
Create a dictionary "Apples", store these 12 apple names (key) and price (value) in it. Use a for loop to display the dictionary content.
Key (Name)
Value (Price/lb)
Fuji Apples
0.94
Honeycrisp Apples
1.54
Gala Apples
0.84
Envy Apples
1.60
Red Delicious Apples
1.00
Granny Smith Apples
1.06
Pink Lady Apples
0.99
Jazz Apples
0.99
Cosmic Crisp Apples
1.18
Opal Apples
0.87
SugarBee Apples
2.27
Golden Delicious Apples
1.24
Create a 12 x 4 Two-dimensional list Itemsto save users selection input including Apple Name, Price, Lbs, calculate subtotal, set default value to 0.
# arr =[[0 for i in range(cols)] for j in range(rows)]
Items =[[0 for i in range(4)] for j in range(12)]
float()
(hint: Create a for loop to ask users to enter each item information, -1 stop the loop when enter Apple name, for example, user entered following items, save these information to the list):
You need to declare a counter to record how many items selected.
Apple Name Price Lbs (weight) Subtotal
Fuji Apples
0.94
5
4.70
Envy Apples
1.60
2
3.20
Red Delicious Apples
1.00
6
6.00
Granny Smith Apples
1.06
3
3.18
Jazz Apples
0.99
5
4.95
Gala Apples
0.84
10
8.40
The subtotal is the result of (weight x price).
3. Create a nested for loop to go through the list, display the items with item name, price, weight, subtotal.
Create a for loop to add all subtotal values together.
Calculate Tax, Tax = subtotal *0.065
Calculate Total= Tax + subtotal
Display Tax, Total

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!