Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Exercise 3.20 JHTP (Salary Calculator): Develop a Java application that determines the gross pay for each of three (3) employees. The company pays straight time for the first 40 hours worked by each...

1 answer below »

Exercise 3.20 JHTP (Salary Calculator): Develop a Java application that determines the gross pay for each of three (3) employees. The company pays straight time for the first 40 hours worked by each employee and time and a half for all hours worked in excess of 40. You’re given a list of employees, their number of hours worked last week, and their hourly rates [create your own information/data here to input into the program]. Your program should input this information/data for each employee, then determine and display the employee’s gross pay. Use class Scanner to input the employee data.


Work must include comments

Answered Same Day Jun 30, 2021

Solution

Aditya answered on Jul 01 2021
143 Votes
import java.util.Scanner;
public class Employee
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
declaring scanner object scan to take input from use

float hourlyRateEmployeeFirst;
variable to store the hourly rate of first employee
float hoursWorkedEmployeeFirst;
variable to store the hours worked of first employee
float payEmployeeFirst;
variable to store the pay of the first employee

float hourlyRateEmployeeSecond;
variable to store the hourly rate of second employee
float hoursWorkedEmployeeSecond;
variable to store the hours worked of second employee
float payEmployeeSecond;
variable to store the pay of the second employee

float hourlyRateEmployeeThird;
variable to store the hourly rate of third employee
float hoursWorkedEmployeeThird;
variable to store the hours worked of third employee
float payEmployeeThird;
variable to store the pay of the third employee

System.out.print("Enter the hourly rate: ");
prompting user to enter hourly rate for first employee
hourlyRateEmployeeFirst = scan.nextFloat();
storing the user input into hourlyRateEmployeeFirst using scan Scanner object
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here