please help me asap Implement the design of the Laptop and Store classes so that the following code generates the output below: print("Total Laptop Created:",Laptop.total_laptop) print("1.=========================================") s1 = Store() p1 = Laptop("Lenovo B4180", 55000) print("2.=========================================") p2 = Laptop("HP Pavilion") print("3.=========================================") s1.add_laptop(p1, p2) print("4.=========================================") p2.setPrice(77000) s1.add_laptop(p2) print("5.=========================================") s1.sell_laptop("HP Probook") print("6.=========================================") print(s1) print("7.=========================================") s2 = Store("Star Tech") p3 = Laptop("HP Probook", 58000) print("8.=========================================") p4 = Laptop("Lenovo Thinkpad", 60000) print("9.=========================================") p5 = Laptop("HP Elite", 80000) print("10.=========================================") s2.add_laptop(p3, p4, p5) print("11.=========================================") print(s2) print("12.=========================================") s2.sell_laptop("HP Probook") print("13.=========================================") print(s2) print("14.=========================================") print("Total Laptop Created:",Laptop.total_laptop) OUTPUT: Total Laptop Created: 0 1.========================================= Laptop created. Model: Lenovo B4180 Price: 55000 2.========================================= Laptop created. Model: HP Pavilion Price: Not Set 3.========================================= Lenovo B4180 model has been added to Ryans store. You can not add HP Pavilion without price 4.========================================= HP Pavilion model has been added to Ryans store. 5.========================================= HP Probook is not available at the Ryans store 6.========================================= Store Name: Ryans List of available Laptops: Model Name: Lenovo B4180 --> Price: 55000 Model Name: HP Pavilion --> Price: 77000 Total Laptop in Stock: 2 Total Price of Stocked Laptops: 132000 7.========================================= Laptop created. Model: HP Probook Price: 58000 8.========================================= Laptop created. Model: Lenovo Thinkpad Price: 60000 9.========================================= Laptop created. Model: HP Elite Price: 80000 10.========================================= HP Probook model has been added to Star Tech store. Lenovo Thinkpad model has been added to Star Tech store. HP Elite model has been added to Star Tech store. 11.========================================= Store Name: Star Tech List of available Laptops: Model Name: HP Probook --> Price: 58000 Model Name: Lenovo Thinkpad --> Price: 60000 Model Name: HP Elite --> Price: 80000 Total Laptop in Stock: 3 Total Price of Stocked Laptops: 198000 12.========================================= HP Probook has been sold at the price 58000 13.========================================= Store Name: Star Tech List of available Laptops: Model Name: Lenovo Thinkpad --> Price: 60000 Model Name: HP Elite --> Price: 80000 Total Laptop in Stock: 2 Total Price of Stocked Laptops: 140000 14.========================================= Total Laptop Created: 5
please help me asap
Implement the design of the Laptop and Store classes so that the following
code generates the output below:
print("Total Laptop Created:",Laptop.total_laptop)
print("1.=========================================")
s1 = Store()
p1 = Laptop("Lenovo B4180", 55000)
print("2.=========================================")
p2 = Laptop("HP Pavilion")
print("3.=========================================")
s1.add_laptop(p1, p2)
print("4.=========================================")
p2.setPrice(77000)
s1.add_laptop(p2)
print("5.=========================================")
s1.sell_laptop("HP Probook")
print("6.=========================================")
print(s1)
print("7.=========================================")
s2 = Store("Star Tech")
p3 = Laptop("HP Probook", 58000)
print("8.=========================================")
p4 = Laptop("Lenovo Thinkpad", 60000)
print("9.=========================================")
p5 = Laptop("HP Elite", 80000)
print("10.=========================================")
s2.add_laptop(p3, p4, p5)
print("11.=========================================")
print(s2)
print("12.=========================================")
s2.sell_laptop("HP Probook")
print("13.=========================================")
print(s2)
print("14.=========================================")
print("Total Laptop Created:",Laptop.total_laptop)
OUTPUT:
Total Laptop Created: 0
1.=========================================
Laptop created.
Model: Lenovo B4180
Price: 55000
2.=========================================
Laptop created.
Model: HP Pavilion
Price: Not Set
3.=========================================
Lenovo B4180 model has been added to Ryans store.
You can not add HP Pavilion without price
4.=========================================
HP Pavilion model has been added to Ryans store.
5.=========================================
HP Probook is not available at the Ryans store
6.=========================================
Store Name: Ryans
List of available Laptops:
Model Name: Lenovo B4180 --> Price: 55000
Model Name: HP Pavilion --> Price: 77000
Total Laptop in Stock: 2
Total Price of Stocked Laptops: 132000
7.=========================================
Laptop created.
Model: HP Probook
Price: 58000
8.=========================================
Laptop created.
Model: Lenovo Thinkpad
Price: 60000
9.=========================================
Laptop created.
Model: HP Elite
Price: 80000
10.=========================================
HP Probook model has been added to Star Tech store.
Lenovo Thinkpad model has been added to Star Tech store.
HP Elite model has been added to Star Tech store.
11.=========================================
Store Name: Star Tech
List of available Laptops:
Model Name: HP Probook --> Price: 58000
Model Name: Lenovo Thinkpad --> Price: 60000
Model Name: HP Elite --> Price: 80000
Total Laptop in Stock: 3
Total Price of Stocked Laptops: 198000
12.=========================================
HP Probook has been sold at the price 58000
13.=========================================
Store Name: Star Tech
List of available Laptops:
Model Name: Lenovo Thinkpad --> Price: 60000
Model Name: HP Elite --> Price: 80000
Total Laptop in Stock: 2
Total Price of Stocked Laptops: 140000
14.=========================================
Total Laptop Created: 5
Step by step
Solved in 5 steps with 2 images