Why is it meal+meal* tax?



I am not understanding why it is "meal+meal*tax" instead of "meal * tax"

# Reassign meal on line 7!

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal+meal *tax


Meal = meal+meal*tax because if it was just meal*tax you would just be getting the total amount of tax added onto the meal. To get the total cost of the meal which is assigned, you need to do meal + meal * tax which is 51.18. The cost of the meal in the end is the meal along with the tax on that meal.


As @matt_schu already said you need the meal and the taxex for the meal. If you just want to write meal*tax, then you need to adjust the tax: 1.15 instead of 0.15


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.