Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need this coding Assignment done! I provided the instructions and expected outpu

ID: 2247097 • Letter: N

Question

Need this coding Assignment done! I provided the instructions and expected output. The code needs to be in JAVA context.

Thank you!

Instructions: Write a Java program to calculate gross weekly wage (before any taxes are taken out) for hourly paid employees based on total hours worked per week and rate of pay per hour. Choose a proper name for your program indicating what it does, and add "_Lab01" to your chosen name. Full name of your program will be YourChosenName_Lab01.java. Requirements Declare a Scanner object to accept keyboard input. Declare variables, as needed, for loop control, holding user input data, holding the results of the necessary calculation(s), and other variables as you may see necessary Use a while loop for continuous processing. Continuation of the loop will depend on user response to a prompt asking whether to continue or not. Prompt the user for the number of total hours worked per week, accept and store the user input. Prompt the user for the rate of pay, accept and store the user input. Calculate the gross weekly wage based on the total hours worked per week and the rate of pay per hour. Output to the user: 1. 2. 3. 4. 5. 6. 7. a) b) c) The total hours worked per week. The rate of pay per hour. The gross weekly wage. 8. Prompt the user regarding continuing to calculate wages. Expected output Your output need not be identical to that shown here, but you must correctly format the U.S. dollar amount in the output (highlighted portions of output). User input appears in bold-faced, blue type.

Explanation / Answer

GrossWeeklyWages_Lab01.java

import java.util.Scanner;

public class GrossWeeklyWages_Lab01 {

public static void main(String[] args) {

// Scanner object is used to get the inputs entered by the user
Scanner sc = new Scanner(System.in);

//Declaring variables
int hoursWorked;
double rateOfPay, grossWeeklyWage = 0.0;
String str;

/* This while loop continues to execute
* until the user enters a "Yes"
*/
while (true) {

//Getting the inputs entered by the user
System.out.println("How many hours worked per week ?");
hoursWorked = sc.nextInt();

System.out.println("What is the rate of pay per hour ?");
rateOfPay = sc.nextDouble();

//Calculating the gross wages
grossWeeklyWage = hoursWorked * rateOfPay;

//Displaying the output
System.out.println("The Total hours worked per week :" + hoursWorked);
System.out.println("The rate of pay per hour : $" + rateOfPay);
System.out.println("The gross weekly wage : $" + grossWeeklyWage);

// Getting the String from the user 'Yes' or 'No'
System.out.println(" Calculate another wage (Yes/No) ?");
str = sc.next();
if (str.equalsIgnoreCase("YES"))
continue;
else {
System.out.println("Goodbye!");
break;
}
}

}

}

_________________

Output:

How many hours worked per week ?
35
What is the rate of pay per hour ?
9.25
The Total hours worked per week :35
The rate of pay per hour : $9.25
The gross weekly wage : $323.75

Calculate another wage (Yes/No) ?
Yes
How many hours worked per week ?
40
1What is the rate of pay per hour ?
12.50
The Total hours worked per week :40
The rate of pay per hour : $112.5
The gross weekly wage : $4500.0

Calculate another wage (Yes/No) ?
No
Goodbye!


_____________Could you rate me well.Plz .Thank You

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote