This forum is now read-only. Please use our new forums! Go to forums

0 points
over 9 years

Equation

I don’t exactly understand why I am adding the variable “meal twice”? Don’t we just need it once.

Answer 53cd9fe780ff33bd81000003

0 votes

Permalink

You are not adding the meal twice. There are three items that make up the total cost.

  • meal
  • tax
  • tip

Tax is a ‘portion’ of the meal (6.75% or 0.0675 ) we will use 0.0675 as that is the actual ratio of tax cost to meal cost ( tc / mc = 0.0675) and will be the actual number that one would need to multiply with the meal cost to get the tax amount.

The tip is the ‘portion’ of the meal + tax (15% or 0.15) again we are using 0.15 because that is the actual ratio of tip cost to meal + tax cost (tipc/(mc+tc).

Above you will see that the tax and the tip are both dependent on the price of the meal. Therefore you will need the meal price to compute the tax portion. Also you will need the meal+tax price to compute the tip. So putting all of that together we get

total = (meal + (meal * tax)) + (meal + (meal * tax)*tip)

or the less convoluted way below


meal = meal + meal * tax

Using this new meal value we proceed to this

total = meal + (meal*tip) # here you are not adding meal again but rather the amount that arises from multiplying the meal with the tip ‘ratio’ with the new meal price that was calculated above.


Does that Make sense? I feel like a rambled a bit.

points
Submitted by Javis Sullivan
over 9 years

2 comments

Sabrejimmy over 9 years

This also confused me at first. Can parentheses be used for order of operations?

Javis Sullivan over 9 years

I don’t see why not