Lab Exercise 13: Tip Calculator
Due 11:59pm, July 29 so that you can ask me any question on Wednesday.
Use the Firefox browser.
Be srue to open the Error Console. Clear the console messages if necessary.
The problem
The user wants to calculate the amount to tip in a restaurant. The user will provide both the amount of the bill and the tip percentage to be used.
Requirements
- The percentage and bill amounts will be entered into a form, and the results be shown in a textarea.
- The user should be able to enter the percentage as a whole number - for example a 15% tip should be entered as 15.*
- The report should show the original bill amount, the tip percent, the tip amount, and the total cost.
- The tip and total values should be shown in whole cents.
- The report should be organized into columns as indicated. The exact spacing may vary.
Bill Tip Total Cost $17.95 $1.80 $19.75 $20.00 $4 $24.00
- If the user enters another bill and percent, the new line of results should be added to what is already there.
The Lab 13 Start Page has a basic form already created.
- You need to write the JavaScript event handler for the button.
- You will need to add the initial line with the column headings in the textarea.
Submit your work using Blackboard
Note
*To compute the tip, multiply by the decimal percent. If the entered amount is 15%, you must multiply by 0.15. Your script will have to divide the original value by 100.
Submit your work
- Upload your file to your public_html directory on wyrd.hood.edu.
- Provide a hyperlink to the page in the submission form on Blackboard.
Comments to: dong@hood.edu
Last Modified: 27 July 2015. 20:52