Reassign in a Single Line


#1

Reassign meal on line 7!

meal = 44.50
tax = 6.75 / 100
tip = 15.0 / 100

meal = meal + meal * tax

Why cant you just do

meal = meal * tax

why do you have to put meal twice ?


#2

Hi, how are you?

Well, keep in mind that you’re adding the percentage to the total, and not searching the percentage.

e.g.

If you multiply $100 by 0,065 (6,5%), you’ll have $6,50, which is 6,5% of 100, correct? But, if you do
100 + ( 100 * 0,065), you’re currently adding to $100 the respective 6,5% percentage, in other words, you’re adding $6,50 to $100 = $106,50 (the meal price + taxes).

Get it?

Hope i’ve helped!
Cheeers!


#3

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