Question: Consider your tip.html page from Exercise 5.9. If you enter a check amount of $17.73 and select a 15% tip, the page will report 'You
Consider your tip.html page from Exercise 5.9. If you enter a check amount of $17.73 and select a 15% tip, the page will report 'You should tip $2.6595.' While mathematically accurate, this amount of precision is overkill. When dealing with dollars and cents, you really want the answer rounded up to two decimal places. In this case, $2.66.
Modify your tip.html page so that the tip amount is rounded up to two decimal places. Note that to round up, you will need to use the Math.ceil function instead of Math.round (which can round either up or down, depending on which integer value is closer)?
Step by Step Solution
3.27 Rating (159 Votes )
There are 3 Steps involved in it
Tip Calculator ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
1409-C-S-O-S(992).docx
120 KBs Word File
