Solve the question with python Design Foodcart class and Food class so that the following code provides the expected output. cart1 = Foodcart() food1 = Food('Burger','Chillox',180) food2 = Food.createFood('Cake','Mr. Baker',1000) print("===========================") print(food1) print("===========================") cart1.addFood(food1,food2) print("===========================") cart1.setCartName("Foodpanda") cart1.addFood(food1,food2) cart1.addFood(Food('Steak','Woodhouse Grill',2000)) print("Total Price Available:",Foodcart.totalPrice) print("===========================") print("Total Foods created:",Food.totalFoods) print("===========================") cart1.printCartDetails() print("===========================") cart1.removeFood("French Fry") print("===========================") cart1.removeFood("Steak") print("===========================") cart1.printCartDetails() print("===========================") print("Total Price Available:",Foodcart.totalPrice
Solve the question with python
Design Foodcart class and Food class so that the following code provides
the expected output.
cart1 = Foodcart()
food1 = Food('Burger','Chillox',180)
food2 = Food.createFood('Cake','Mr. Baker',1000)
print("===========================")
print(food1)
print("===========================")
cart1.addFood(food1,food2)
print("===========================")
cart1.setCartName("Foodpanda")
cart1.addFood(food1,food2)
cart1.addFood(Food('Steak','Woodhouse Grill',2000))
print("Total Price Available:",Foodcart.totalPrice)
print("===========================")
print("Total Foods created:",Food.totalFoods)
print("===========================")
cart1.printCartDetails()
print("===========================")
cart1.removeFood("French Fry")
print("===========================")
cart1.removeFood("Steak")
print("===========================")
cart1.printCartDetails()
print("===========================")
print("Total Price Available:",Foodcart.totalPrice)
Step by step
Solved in 4 steps with 3 images