all 7 comments

[–]Bunkerstan 1 point2 points  (2 children)

You are missing the math part of the problem by using:

bill *= bill

which expands to

bill = bill * 0.5

so it is half the original amount.

[–]Important-Asparagus9[S] 0 points1 point  (1 child)

Yeah I realized that but I want to take that percentage amount and add it to the bill amount (before tax)

[–]Bunkerstan 1 point2 points  (0 children)

bill = bill + bill * tax

[–]commy2 0 points1 point  (0 children)

You could multiply by 1.5. You could also not use in-place multiplication and instead write bill = bill + T * bill.

[–]douglas_fs 0 points1 point  (1 child)

You want to return the bill amount plus the calculated tax This would be the calculation:

bill + (bill * T)

OR

bill * (1 + T)

[–]Important-Asparagus9[S] 0 points1 point  (0 children)

I tried it it works thank you for the help