Question: 2 Implement the design of the Purchaser and AarongProducts classes so that the following code generates the output below: #Write your code here p1 = Purchaser('Alex Light') print('1.===============================') print(p1) product1 = AarongProducts('Decor', 'Photo-Frame') print('2.===============================') print(product1) print('3.===============================') print(AarongProducts.products) print('4.===============================') AarongProducts.include_products('Souvenirs',['Brass-Flowervase 2170', 'Terracotta-Vase 3500']) print(f'Updated Item List:\n{AarongProducts.products}') print('5.===============================') product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2) print(product2) print('6.===============================') p1.create_invoice(product1, product2) print('7.===============================') product3 = AarongProducts('Decor', 'Candles', 5) print(product3) print('8.===============================') product4 = AarongProducts('Souvenirs', 'Brass Sail-boats', 2) print(product4) print('9.===============================') p2 = Purchaser('Emma Lord', 'M01-23') print(p2) print('10.==============================') p2.create_invoice(product1, product3, product4) OUTPUT: 1.=============================== Customer SL no.: 1 Customer Name: Alex Light Registered Customer ID: None 2.=============================== Products Order Details: 1 Photo-Frame. 3.=============================== {'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles': 350}, 'Souvenirs': {'Brass Sail-boats': 2200}} 4.=============================== Updated Item List: {'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles': 350}, 'Souvenirs': {'Brass Sail-boats': 2200, 'Brass-Flowervase': 2170, 'Terracotta-Vase': 3500}} 5.=============================== Products Order Details: 2 Terracotta-Vase. 6.=============================== Total Bill of Alex Light: 8240.0 Tk. 7.=============================== Products Order Details: 5 Candles. 8.=============================== Products Order Details: 2 Brass Sail-boats. 9.=============================== Customer SL no.: 2 Customer Name: Emma Lord Registered Customer ID: M01-23 Registered Customer will get 10% discount 10.============================== Total Bill of Emma Lord: 6651.0 Tk.
Question: 2 Implement the design of the Purchaser and AarongProducts classes so that the following code generates the output below: #Write your code here p1 = Purchaser('Alex Light') print('1.===============================') print(p1) product1 = AarongProducts('Decor', 'Photo-Frame') print('2.===============================') print(product1) print('3.===============================') print(AarongProducts.products) print('4.===============================') AarongProducts.include_products('Souvenirs',['Brass-Flowervase 2170', 'Terracotta-Vase 3500']) print(f'Updated Item List:\n{AarongProducts.products}') print('5.===============================') product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2) print(product2) print('6.===============================') p1.create_invoice(product1, product2) print('7.===============================') product3 = AarongProducts('Decor', 'Candles', 5) print(product3) print('8.===============================') product4 = AarongProducts('Souvenirs', 'Brass Sail-boats', 2) print(product4) print('9.===============================') p2 = Purchaser('Emma Lord', 'M01-23') print(p2) print('10.==============================') p2.create_invoice(product1, product3, product4) OUTPUT: 1.=============================== Customer SL no.: 1 Customer Name: Alex Light Registered Customer ID: None 2.=============================== Products Order Details: 1 Photo-Frame. 3.=============================== {'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles': 350}, 'Souvenirs': {'Brass Sail-boats': 2200}} 4.=============================== Updated Item List: {'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles': 350}, 'Souvenirs': {'Brass Sail-boats': 2200, 'Brass-Flowervase': 2170, 'Terracotta-Vase': 3500}} 5.=============================== Products Order Details: 2 Terracotta-Vase. 6.=============================== Total Bill of Alex Light: 8240.0 Tk. 7.=============================== Products Order Details: 5 Candles. 8.=============================== Products Order Details: 2 Brass Sail-boats. 9.=============================== Customer SL no.: 2 Customer Name: Emma Lord Registered Customer ID: M01-23 Registered Customer will get 10% discount 10.============================== Total Bill of Emma Lord: 6651.0 Tk.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Question: 2
Implement the design of the Purchaser and AarongProducts classes so that
the following code generates the output below:
#Write your code here
p1 = Purchaser('Alex Light')
print('1.===============================')
print(p1)
product1 = AarongProducts('Decor', 'Photo-Frame')
print('2.===============================')
print(product1)
print('3.===============================')
print(AarongProducts.products)
print('4.===============================')
AarongProducts.include_products('Souvenirs',['Brass-Flowervase
2170', 'Terracotta-Vase 3500'])
print(f'Updated Item List:\n{AarongProducts.products}')
print('5.===============================')
product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2)
print(product2)
print('6.===============================')
p1.create_invoice(product1, product2)
print('7.===============================')
product3 = AarongProducts('Decor', 'Candles', 5)
print(product3)
print('8.===============================')
product4 = AarongProducts('Souvenirs', 'Brass Sail-boats', 2)
print(product4)
print('9.===============================')
p2 = Purchaser('Emma Lord', 'M01-23')
print(p2)
print('10.==============================')
p2.create_invoice(product1, product3, product4)
OUTPUT:
1.===============================
Customer SL no.: 1
Customer Name: Alex Light
Registered Customer ID: None
2.===============================
Products Order Details:
1 Photo-Frame.
3.===============================
{'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles':
350}, 'Souvenirs': {'Brass Sail-boats': 2200}}
4.===============================
Updated Item List:
{'Decor': {'Small-Mirror': 1110, 'Photo-Frame': 1240, 'Candles':
350}, 'Souvenirs': {'Brass Sail-boats': 2200, 'Brass-Flowervase':
2170, 'Terracotta-Vase': 3500}}
5.===============================
Products Order Details:
2 Terracotta-Vase.
6.===============================
Total Bill of Alex Light:
8240.0 Tk.
7.===============================
Products Order Details:
5 Candles.
8.===============================
Products Order Details:
2 Brass Sail-boats.
9.===============================
Customer SL no.: 2
Customer Name: Emma Lord
Registered Customer ID: M01-23
Registered Customer will get 10% discount
10.==============================
Total Bill of Emma Lord:
6651.0 Tk.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 7 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education