Python Forum
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tip calculator problem
#1
Task Details : You've finished eating at a restaurant, and received this bill:

   Cost of meal: $44.50
   Restaurant tax: 6.75%
   Tip: 15%

You'll apply the tip to the overall cost of the meal (including tax).
Instructions

First, let's declare the variable meal and assign it the value 44.50.

# Assign the variable meal the value 44.50 on line 3!

variable_meal = 44.50
variable_tax = 6.75 
variable_tip = 15


print('Meal', variable_meal,)


variable_tax = (variable_meal * variable_tax / 100)

print('Tax', variable_tax,)

variable_meal_tex = ( variable_meal + variable_tax)

variable_tip = (variable_meal_tex * variable_tip / 100)

print('tip', variable_tip,)
Error:
Oops, try again. It looks like meal is set to 54.6293125 instead of 44.50.
Reply
#2
Seems to work fine for me.

Output:
Meal 44.5 Tax 3.00375 tip 7.1255625
Perhaps a problem with the testing software?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  calculator app problem jacksfrustration 1 196 Apr-11-2024, 03:09 PM
Last Post: deanhystad
  Calculator problem BeginnerCoderPaero 4 3,376 Jun-29-2018, 09:21 AM
Last Post: BeginnerCoderPaero
  Beginner. Calculator problem ¯\_(ツ)_/¯ stykus1992 0 2,350 Feb-15-2018, 11:01 AM
Last Post: stykus1992

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020