Tip Calculator
The Meal

Now let's apply the concepts from the previous section to a real world example.

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).


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

Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Don't use any dollar signs ($)—just the numerical cost of the meal, 44.50.

Remember, we can assign a value to a variable like so:

variable_name = 10