Download presentation
Presentation is loading. Please wait.
Published byAlexandrina Farmer Modified over 8 years ago
1
Salary Calculator
2
Design a page like the following
4
Basics You must have some CSS. 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.
5
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).
6
User Interaction If user changes the hourly wage, clear out your answer. If the user changes the number of hours worked, clear out your answer. If the user enters a wage which is not a number, alert him/her to the problem and do not calculate.
7
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).
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.