CSC 230: The Week beginning Sept. 3 |
1. Provide a brief definition of the following terms (in the web programming context):
2. Design a page like that seen below. It should have a text input that allows the user to enter the amount of a restaurant bill. It should have a drop-down select that allows the user to choose the percentage tip he/she would like to give. It should have a button which when clicked calculates the amount to pay [amount=bill*(1+percentage) where the percentage is in a decimal format .20 as opposed to 20%].
If you want to do a little extra then add the following functionality: clear out the answer when the user changes the bill amount and clear out the answer when the user chnages the tip percentage. (For a hint see EventDemo.)
(Note that HTML5 supports new input types such as type="number", see http://www.w3schools.com/html5/html5_form_input_types.asp, which could be useful on a page such as this restaurant calculator page.)