Question: CalculatePay.java code: /* Name: FileName: DebugMe.java Assignment: Bonus Lab 1.1 Description: Correct the syntax errors in this program so that it will compile and run.
/*
Name:
FileName: DebugMe.java
Assignment: Bonus Lab 1.1
Description: Correct the syntax errors in this program so that it will compile and run.
Place a line comment above or to the right of each line containing an error
describing what the error was and how it was fixed. For example, missing quotation added or misspelled word corrected.
*/
import java.util.*;
public class DebugMe
public static main(String args) {
Scanner input = new Scanner(System.in);
// Declare and initialize variables for age and name
System.out.println("Enter your name");
string name = input.nextInt( );
System.out.println(Enter your age: );
int age = keyboard.nextLine( );
System.out.Println(" Your name is + name + " and your are " + Age + " years old.");
system.out.pritnln("If you are reading this, then you have found all of the errors in this program");
System.out.println("and the last character on this line should be a backslash \");
{
}
Complete the CalculatePay.java program so it calculates a week's wages for an employee. Assume the employees earn their normal hourly rate for the first forty hours they work during a weck. For any overtime they work, employees are paid time and a half, meaning 1.5 times their normal hourly rate. 1. Prompt the user to input an employee's hourly wage and the total number of hours they worked. 2. Compute the amount of regular hours they worked and the number of overtime hours they worked. Hint: use an if statement and the fact that overtime hours don't start until someone has worked more than 40 hours. 3. Compute their regular pay, overtime pay, and total pay for the week. 4. Displ ay their regular pay, overtime pay, and total pay as shown below Upload your completed CalculatePay Java file on Schoology. You will lose 2% on the lab if you do not put your name in the title block. Sample Runs Input hourly wage: 20 Input number of hours worked: 50 Regular Pay: $800.0 Overtime Pay: S300.0 Total Pay: $1100.0 Input hourly wage: 10 Input number of hours worked: 20 Regular Pay: $200.0 Overtime Pay: S0.0 Total Pay: $200.0 Input hourly wage: 30 Input number of hours worked: 40 Regular Pay: $1200.0 Overtime Pay: S0.0 Total Pay: $1200.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
