A menu will show three items and their prices: (a) Carbonara 100php (b) Fries 80php (c) Chicken nuggets 150php. The user will choose among two food delivery services: (1) Foodie panda and (2) food-deliver. After choosing the food delivery service, a discount and service charge for the item will be computed depending on the service chosen based on the table below. Food Delivery Service Food Discount Delivery Charge (1) Foodie panda 1% +10php (2) Food deliver 4% +30php Example: (a) carbonara 100php (2) Food deliver Discount: 100php X .04 = 4.00 100-4 = 96 php discounted price Delivery charge: 96+30 = 126 php total payment my code: #Output menu print("Items: \n1. Carbonara 100php \n2. Fries 80php \n3. Chicken nuggets 150php.") #Prompt for input choice = int(input("Enter item no: ")) quantity = int(input("Input quantity : ")) #Compare and assign price if choice==1: price = 100 elif choice==2: price = 80 elif choice == 3: price =150 #compute total total = price*quantity #Output result print("Total : ",total," php")
A menu will show three items and their prices: (a) Carbonara 100php (b) Fries 80php (c) Chicken nuggets 150php.
The user will choose among two food delivery services: (1) Foodie panda and (2) food-deliver. After choosing the food delivery service, a discount and service charge for the item will be computed depending on the service chosen based on the table below.
Food Delivery Service |
Food Discount |
Delivery Charge |
(1) Foodie panda |
1% |
+10php |
(2) Food deliver |
4% |
+30php |
Example:
(a) carbonara 100php
(2) Food deliver
Discount: 100php X .04 = 4.00 100-4 = 96 php discounted price
Delivery charge: 96+30 = 126 php total payment
my code:
#Output menu
print("Items: \n1. Carbonara 100php \n2. Fries 80php \n3. Chicken nuggets 150php.")
#Prompt for input
choice = int(input("Enter item no: "))
quantity = int(input("Input quantity : "))
#Compare and assign price
if choice==1:
price = 100
elif choice==2:
price = 80
elif choice == 3:
price =150
#compute total
total = price*quantity
#Output result
print("Total : ",total," php")
Step by step
Solved in 2 steps with 4 images