You are viewing a single comment's thread. Return to all comments →
Because you want to include the meal price in the calculation.
Let's say you have a meal of $50 and you add 10% tip and 20% tax, if you'd do
meal * (tip_percent / 100 + tax_percent / 100)
you'd only get $15, so you add the 1 to include the meal itself.
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
Because you want to include the meal price in the calculation.
Let's say you have a meal of $50 and you add 10% tip and 20% tax, if you'd do
you'd only get $15, so you add the 1 to include the meal itself.