subject

The following program calculates yearly and monthly salary given an hourly wage. The program assumes work-hours-per-week limit of 40 and work-weeks-per-year of 50.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 * weeklyHourselse overtimeHours = weeklyHours - weeklyLimit weeklySalary = hourlyWage * weeklyLimit + (overtimeHours * hourlyWage * 1.5)1.Run the program and observe the salary earned.2. Modify the program to read user input for weeklyHours. Run the program again. import java. util. Scanner;public class Salary { public static void main(String [] args) {Scanner scnr = new Scanner(System. in);int hourlyWage = 0;int weeklyHours = 0;int weeklySalary = 0;int overtimeHours = 0;final int WEEKLY_LIMIT = 40;System. out. println("Enter hourly wage: ");hourlyWage = scnr. nextInt();// FIXME: Get user input value for weeklyHoursweeklyHours = 40;if (weeklyHours <= WEEKLY_LIMIT) {weeklySalary = weeklyHours * hourlyWage;}else {overtimeHours = weeklyHours - WEEKLY_LIMIT;weeklySalary = (int)((hourlyWage * WEEKLY_LIMIT) +(hourlyWage * overtimeHours * 1.5));}System. out. print("Weekly salary is: " + weeklySalary); return;}}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
You know the right answer?
The following program calculates yearly and monthly salary given an hourly wage. The program assumes...
Questions
question
English, 28.12.2020 15:00
question
Mathematics, 28.12.2020 15:00
question
Mathematics, 28.12.2020 15:00
Questions on the website: 13722361