Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Answers
- # 1. Book Purchase Program
- bookA_price = 15.00
- bookB_price = 12.50
- bookC_price = 9.75
- num_bookA = int(input("How many of Book A? "))
- num_bookB = int(input("How many of Book B? "))
- num_bookC = int(input("How many of Book C? "))
- total_bookA_price = num_bookA * bookA_price
- total_bookB_price = num_bookB * bookB_price
- total_bookC_price = num_bookC * bookC_price
- total_price = total_bookA_price + total_bookB_price + total_bookC_price
- print("Total price:", total_price)
- # 2. Movie Ticket Counter
- adult_ticket_price = 10.00
- child_ticket_price = 6.00
- num_adult_tickets = int(input("How many adult tickets? "))
- num_child_tickets = int(input("How many child tickets? "))
- total_adult_price = num_adult_tickets * adult_ticket_price
- total_child_price = num_child_tickets * child_ticket_price
- total_price = total_adult_price + total_child_price
- print("Total cost:", total_price)
- # 3. Fruit Purchase Calculator
- apple_price = 0.50
- banana_price = 0.30
- orange_price = 0.60
- num_apples = int(input("How many apples? "))
- num_bananas = int(input("How many bananas? "))
- num_oranges = int(input("How many oranges? "))
- total_apple_price = num_apples * apple_price
- total_banana_price = num_bananas * banana_price
- total_orange_price = num_oranges * orange_price
- total_price = total_apple_price + total_banana_price + total_orange_price
- print("Total price:", total_price)
- # 4. Grocery Shopping
- bread_price = 2.00
- milk_price = 1.50
- egg_price = 0.20
- num_breads = int(input("How many bread loaves? "))
- num_milk = int(input("How many bottles of milk? "))
- num_eggs = int(input("How many eggs? "))
- total_bread_price = num_breads * bread_price
- total_milk_price = num_milk * milk_price
- total_egg_price = num_eggs * egg_price
- total_price = total_bread_price + total_milk_price + total_egg_price
- if total_price > 10.00:
- total_price = total_price - 1.00
- print("Total cost after discount (if applicable):", total_price)
- # 5. Stationery Purchase
- pen_price = 1.20
- notebook_price = 3.00
- eraser_price = 0.50
- num_pens = int(input("How many pens? "))
- num_notebooks = int(input("How many notebooks? "))
- num_erasers = int(input("How many erasers? "))
- total_pen_price = num_pens * pen_price
- total_notebook_price = num_notebooks * notebook_price
- total_eraser_price = num_erasers * eraser_price
- total_price = total_pen_price + total_notebook_price + total_eraser_price
- print("Total price:", total_price)
- # 6. Snack Order Calculator
- chips_price = 1.50
- chocolate_price = 2.00
- soda_price = 1.00
- num_chips = int(input("How many packs of chips? "))
- num_chocolate = int(input("How many chocolate bars? "))
- num_soda = int(input("How many bottles of soda? "))
- if num_chips >= 3:
- chips_price = chips_price - 0.25
- if num_chocolate >= 3:
- chocolate_price = chocolate_price - 0.25
- if num_soda >= 3:
- soda_price = soda_price - 0.25
- total_chips_price = num_chips * chips_price
- total_chocolate_price = num_chocolate * chocolate_price
- total_soda_price = num_soda * soda_price
- total_price = total_chips_price + total_chocolate_price + total_soda_price
- print("Total price:", total_price)
- # 7. Toy Shop Program
- doll_price = 8.00
- car_price = 6.50
- action_figure_price = 7.75
- num_dolls = int(input("How many dolls? "))
- num_cars = int(input("How many cars? "))
- num_action_figures = int(input("How many action figures? "))
- total_doll_price = num_dolls * doll_price
- total_car_price = num_cars * car_price
- total_action_figure_price = num_action_figures * action_figure_price
- total_price = total_doll_price + total_car_price + total_action_figure_price
- print("Total price:", total_price)
- # 8. Coffee Shop Order
- espresso_price = 2.50
- latte_price = 3.50
- cappuccino_price = 4.00
- num_espresso = int(input("How many espressos? "))
- num_latte = int(input("How many lattes? "))
- num_cappuccino = int(input("How many cappuccinos? "))
- total_espresso_price = num_espresso * espresso_price
- total_latte_price = num_latte * latte_price
- total_cappuccino_price = num_cappuccino * cappuccino_price
- total_price = total_espresso_price + total_latte_price + total_cappuccino_price
- print("Total price:", total_price)
- # 9. Pizza Order
- small_price = 8.00
- medium_price = 12.00
- large_price = 15.00
- num_small = int(input("How many small pizzas? "))
- num_medium = int(input("How many medium pizzas? "))
- num_large = int(input("How many large pizzas? "))
- total_small_price = num_small * small_price
- total_medium_price = num_medium * medium_price
- total_large_price = num_large * large_price
- total_price = total_small_price + total_medium_price + total_large_price
- print("Total price:", total_price)
- # 10. Concert Ticket Sales
- regular_ticket_price = 20.00
- vip_ticket_price = 50.00
- student_ticket_price = 15.00
- num_regular = int(input("How many regular tickets? "))
- num_vip = int(input("How many VIP tickets? "))
- num_student = int(input("How many student tickets? "))
- total_regular_price = num_regular * regular_ticket_price
- total_vip_price = num_vip * vip_ticket_price
- total_student_price = num_student * student_ticket_price
- total_price = total_regular_price + total_vip_price + total_student_price
- group_size = num_regular + num_vip + num_student
- if group_size >= 5:
- total_price = total_price * 0.80
- print("Total price:", total_price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement