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 22:00
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
You know the right answer?
The following program calculates yearly and monthly salary given an hourly wage. The program assumes...
Questions
question
Advanced Placement (AP), 05.09.2020 06:01
question
Mathematics, 05.09.2020 06:01
Questions on the website: 13722362