Download presentation
Presentation is loading. Please wait.
Published byLynette Higgins Modified over 9 years ago
1
Salary Calculator
2
Design a page like the following
4
Basics (style) You must have some CSS. The body should have a non-default – Background color – Color – Font family The text inputs should be right justified. The button should not be default gray.
5
Basics (interaction) You must use jQuery. The user enters the hourly wage in a text input. The user enters the numbers of hours worked in a text input. The user clicks a button and the weekly salary is calculated and displayed.
6
Calculation If the user worked less than 40 hours, then the salary is the hours times the hourly wage, e.g. 30 hours at $10.00 an hour gives $300.00. If the user worked more than 40 hours, then he/she makes the regular wage for the first 40 hours and 1.5 * wage for each hour exceeding 40. e.g. 50 hours at $10.00 hour gives $550.00 (40*10.00 + (50-40)*1.5*10.00).
7
User Interaction If user changes the hourly wage, clear out your answer. Use the key-down event. If the user changes the number of hours worked, clear out your answer. If the user enters a wage which is not a number (isNaN), alert him/her to the problem and do not calculate.
8
User Interaction (Cont.) If the user enters a number of hours that is larger than 84, alert him/her to the problem and do not calculate. If the user enters a wage which is not a number, alert him/her to the problem and do not calculate. Display the result formatted as currency – with dollar sign and two decimal places (toFixed).
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.