Question: in java zyDE 3 . 2 0 . 1 : Calculate salary: Calculate overtime using branches. The following program calculates weekly salary and assumes work

in java
zyDE 3.20.1: Calculate salary: Calculate overtime using branches.
The following program calculates weekly salary and assumes work-hours-per-week limit of 40.
Overtime refers to hours worked per week in excess of some weekly limit, such as 40 hours. Some companies pay time-and-a-half for overtime hours, meaning overtime hours are paid at 1.5 times the hourly wage.
Overtime pay can be calculated with pseudocode as follows (assuming a weekly limit of 40 hours):
weeklyLimit =40
if weeklyHours <= weeklyLimit
weeklySalary = hourlyWage * weeklyHours
else
overtimeHours = weeklyHours - weeklyLimit
weeklySalary = hourlyWage * weeklyLimit +(overtimeHours * hourlyWage *1.5)
Run the program and observe the salary earned.
Modify the program to read user input for weeklyHours. Run the program again.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!