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 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
Which of the choices sean are not true when considering virus behavior
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
I'm taking a class on how to make a movie, and it offers some apps that would be in the process. the thing is, i don't have any of those ha. if you have any tips on some apps i could use, that would be awesome. i don't have an iphone, so don't suggest any apps like imovie. i know that this is a weird question, but it would be super for me. : )
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
You know the right answer?
The following program calculates yearly and monthly salary given an hourly wage. The program assumes...
Questions
question
Mathematics, 17.09.2019 16:00
question
Mathematics, 17.09.2019 16:00
Questions on the website: 13722360