Advertisement
Guest User

3. Sushi time

a guest
Dec 12th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.99 KB | None | 0 0
  1. import math
  2. sushi_type = input()
  3. name_restaurant = input()
  4. N_portion = int(input())
  5. take_home = input()
  6. price_food = 0
  7.  
  8. if name_restaurant == 'Sushi Zone':
  9.     if sushi_type == 'sashimi':
  10.         price_food = 4.99
  11.     elif sushi_type == 'maki':
  12.         price_food = 5.29
  13.     elif sushi_type == 'uramaki':
  14.         price_food = 5.99
  15.     elif sushi_type == "temaki":
  16.         price_food = 4.29
  17.     total_price = price_food * N_portion
  18.  
  19.     if take_home == 'Y':
  20.             total_price = math.ceil(total_price * 1.2)
  21.  
  22.     print(f'Total price: {math.ceil(total_price)} lv.')
  23. elif name_restaurant == 'Sushi Time':
  24.     if sushi_type == 'sashimi':
  25.         price_food = 5.49
  26.     elif sushi_type == 'maki':
  27.         price_food = 4.69
  28.     elif sushi_type == 'uramaki':
  29.         price_food = 4.49
  30.     elif sushi_type == "temaki":
  31.         price_food = 5.19
  32.     total_price = price_food * N_portion
  33.  
  34.     if take_home == 'Y':
  35.         total_price = math.ceil(total_price * 1.2)
  36.  
  37.     print(f'Total price: {math.ceil(total_price)} lv.')
  38. elif name_restaurant == 'Sushi Bar':
  39.     if sushi_type == 'sashimi':
  40.         price_food = 5.25
  41.     elif sushi_type == 'maki':
  42.         price_food = 5.55
  43.     elif sushi_type == 'uramaki':
  44.         price_food = 6.25
  45.     elif sushi_type == "temaki":
  46.         price_food = 4.75
  47.     total_price = price_food * N_portion
  48.  
  49.     if take_home == 'Y':
  50.         total_price = math.ceil(total_price * 1.2)
  51.  
  52.     print(f'Total price: {math.ceil(total_price)} lv.')
  53. elif name_restaurant == 'Asian Pub':
  54.     if sushi_type == 'sashimi':
  55.         price_food = 4.5
  56.     elif sushi_type == 'maki':
  57.         price_food = 4.8
  58.     elif sushi_type == 'uramaki':
  59.         price_food = 5.50
  60.     elif sushi_type == "temaki":
  61.         price_food = 5.5
  62.     total_price = price_food * N_portion
  63.  
  64.     if take_home == 'Y':
  65.         total_price = math.ceil(total_price * 1.2)
  66.  
  67.     print(f'Total price: {math.ceil(total_price)} lv.')
  68.  
  69. else:
  70.     print(f'{name_restaurant} is invalid restaurant!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement