Advertisement
Aodai

Untitled

Sep 6th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. #Meal Cost Calculation
  2. mealCost = input('Enter the cost of your meal:' + '\n$') #Meal Cost
  3. tax = float(mealCost) * float(0.07) #Meal Tax
  4. tip = float(mealCost) * float(0.15) #Meal Tip
  5. totalMealCost = float(mealCost) + float(tip) + float(tax) #Meal Total Cost
  6. print('\n'
  7.       + 'The initial cost of your meal:' + '\n$' + str(float(mealCost)) + '\n' + '\n'
  8.       + 'The tax amount:' + '\n$' + str(float(format(tax, '.2f'))) + '\n' + '\n'
  9.       + 'The tip amount:' + '\n$' + str(float(format(tip, '.2f'))) + '\n' + '\n'
  10.       + 'The total cost of your meal:' + '\n$' + str(float(format(totalMealCost, '.2f'))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement