Computers and Technology

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;}}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:00, Cocco
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
image
Computers and Technology, 22.06.2019 19:00, alyssashae1818
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, jack487
How can a user delete a drawing object
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, bubbles173883
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a. edit the sizes and other characteristics of photos that have been inserted. b. take a screenshot of an image and copy it to the clipboard for pasting. c. search for drawings or other images from a library of prepared pictures. d. make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
Do you know the correct answer?
The following program calculates yearly and monthly salary given an hourly wage. The program assumes...

Questions in other subjects: