Question

RUN THIS PROGRAM ON NETBEANS As a Software Developer, you have received a requirement from a Company to implement a prot...

RUN THIS PROGRAM ON NETBEANS

As a Software Developer, you have received a requirement from a Company to implement a

prototype for its payroll system.

You receive the following specifications:

If an employee works more than its regular hours, it is considered overtime and it will be

paid based on the employee’s experience.

All employees are paid biweekly (80 hours)

Employee taxes: 1%

This company manages three categories of workers based on employee’s experience.


Group 1 (Silver)

o Pay rate: $20 per hour

o Regular hours: 80 hours(biweekly)

o Overtime Factor 1.5

o Retirement plan (2% of the gross pay)

o Health insurance ($250)

Group 2 (Golden)

o Pay rate: $25 per hour

o Regular hours: 80 hours(biweekly)

o Overtime Factor 2

o Retirement plan (3% of the gross pay)

o Health insurance ($200)

Group 3 (Platinum)

o Pay rate: $30 per hour

o Regular hours: 80 hours(biweekly)

o Overtime Factor 2.5

o Retirement plan (3.5% of the gross pay)

o Health insurance ($150)

Your program should prompt the user (customer) to enter the following information:

Employee’s name

Number of hours worked

Employee group (1 Silver , 2 Golden or 3 Platinum)



-----The program then outputs the following information:

Employee’s name

Type of Employee (“Silver”, “Golden” or “Platinum”– not 1, 2 or 3)

Total number of hours worked.

Hourly pay rate

Gross Pay

Retirement deduction

Insurance deduction

Employee taxes

Net pay

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Thanks for the question.

Here is the completed code for this problem.  Let me know if you have any doubts or if you need anything to change.

Thank You !!

================================================================================================


import java.util.Scanner;

public class EmployeePayroll {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter Employee's name: ");
        String employeeName = scanner.nextLine();
        System.out.print("Enter Number of hours worked: ");
        int hoursWorked = scanner.nextInt();
        System.out.print("Select Employee Group ([1]Silver [2]Golden [3]Platinum): ");
        int group = scanner.nextInt();

        switch (group) {
            case 1:
                silverPaySlip(employeeName, hoursWorked);
                break;
            case 2:
                goldenPaySlip(employeeName, hoursWorked);
                break;
            case 3:
                platinumPaySlip(employeeName, hoursWorked);
                break;
            default:
                System.out.println("Invalid group selected.");
        }
    }

    private static void platinumPaySlip(String employeeName, int hoursWorked) {
        double grossPay = hoursWorked<=80?hoursWorked*30 : (80*30 + (hoursWorked-80)*30*2.5);
        System.out.println("Employee Name:                " + employeeName);
        System.out.println("Type of Employee:             " + "Silver");
        System.out.println("Total number of hours worked: " + hoursWorked + " hrs");
        System.out.println("Hourly Rate:                  $" + 30.00);
        System.out.println("Gross Pay:                    $" + grossPay);
        System.out.println("Retirement Deduction:         $" + String.format("%.2f",0.035 *grossPay));
        System.out.println("Insurance Deduction:          $" + 150);
        System.out.println("Employee Taxes:               $" + String.format("%.2f",0.01 * grossPay));
        double netPay = grossPay - (0.035 * grossPay + 150 + 0.01 * grossPay);
        System.out.println("Net Pay:                      $"+String.format("%.2f",netPay));

    }

    private static void goldenPaySlip(String employeeName, int hoursWorked) {
        double grossPay = hoursWorked<=80?hoursWorked*25 : (80*25 + (hoursWorked-80)*25*2);
        System.out.println("Employee Name:                " + employeeName);
        System.out.println("Type of Employee:             " + "Silver");
        System.out.println("Total number of hours worked: " + hoursWorked + " hrs");
        System.out.println("Hourly Rate:                  $" + 25.00);
        System.out.println("Gross Pay:                    $" + grossPay);
        System.out.println("Retirement Deduction:         $" + String.format("%.2f",0.03 *grossPay));
        System.out.println("Insurance Deduction:          $" + 200);
        System.out.println("Employee Taxes:               $" + String.format("%.2f",0.01 * grossPay));
        double netPay = grossPay - (0.03 * grossPay + 200 + 0.01 * grossPay);
        System.out.println("Net Pay:                      $"+String.format("%.2f",netPay));

    }

    private static void silverPaySlip(String employeeName, int hoursWorked) {

        double grossPay = hoursWorked<=80?hoursWorked*20 : (80*20 + (hoursWorked-80)*20*1.5);
        System.out.println("Employee Name:a                " + employeeName);
        System.out.println("Type of Employee:             " + "Silver");
        System.out.println("Total number of hours worked: " + hoursWorked + " hrs");
        System.out.println("Hourly Rate:                  $" + 20.00);
        System.out.println("Gross Pay:                    $" + grossPay);
        System.out.println("Retirement Deduction:         $" + String.format("%.2f",0.02 *grossPay));
        System.out.println("Insurance Deduction:          $" + 250);
        System.out.println("Employee Taxes:               $" + String.format("%.2f",0.01 * grossPay));
        double netPay = grossPay - (0.02 * grossPay + 250 + 0.01 * grossPay);
        System.out.println("Net Pay:                      $"+String.format("%.2f",netPay));

    }
}

=======================================================================================

EmployeePayroll.java x hoursWorked hrs); System. out.println (Total number of hours worked: 49 $ 25.00); 50 System.out.p

Add a comment
Know the answer?
Add Answer to:
RUN THIS PROGRAM ON NETBEANS As a Software Developer, you have received a requirement from a Company to implement a prot...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Stark Company has five employees. Employees paid by the hour earn $15 per hour for the...

    Stark Company has five employees. Employees paid by the hour earn $15 per hour for the regular 40-hour workweek and $20 per hour beyond the 40 hours per week. Hourly employees are paid every two weeks, but salaried employees are paid monthly on the last biweekly payday of each month. FICA Social Security taxes are 6.2% of the first $128,400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. FUTA taxes are 0.6% and SUTA taxes...

  • Stark Company has five employees. Employees paid by the hour earn $14 per hour for the...

    Stark Company has five employees. Employees paid by the hour earn $14 per hour for the regular 40 hour workweek and $19 per hour beyond the 40 hours per week. Hourly employees are paid every two weeks, but salaried employees are paid monthly on the last biweekly payday of each month. FICA Social Security taxes are 6.2% of the first $128,400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. FUTA taxes are 0.6% and SUTA...

  • C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their...

    C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...

  • Hemal Thomas is an employee in British Columbia. The net pay calculation is for the first biweekly pay of 2015. The employee is 32 years old and in this pay is entitled to 70 hours’ regular pay at $20.00/hour, three hours of overtime at time and a half, a

    Hemal Thomas is an employee in British Columbia. The net pay calculation is for the first biweekly pay of 2015. The employee is 32 years old and in this pay is entitled to 70 hours’ regular pay at $20.00/hour, three hours of overtime at time and a half, and a $100.00 safety shoe allowance. The employee also receives a monthly car allowance of $200.00 and the employer pays group life insurance of $35.00 a month. Vacation at 4% is accrued.The...

  • Acme Parts runs a small factory and employs workers who are paid one of three hourly...

    Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $17 per hour; second shift, $18.50 per hour; third shift, $22 per hour. Each factory worker might work any number of hours per week; any hours greater than 40 are paid at one and one-half times the usual rate. In addition, second- and third-shift workers can elect to participate in the retirement plan for which 3% of...

  • use at least two functions in your program. . Write a program that calculates weekly payment....

    use at least two functions in your program. . Write a program that calculates weekly payment. The program will ask the user full name, ID number (make one up), and hours worked. An hourly worker’s gross pay is basically his/her work hours that week multiplied by his/her regular hourly pay rate. However, after the first 40 work hours of the week, each additional work hour is paid at an overtime rate that is 1.5 times of the regular hourly rate....

  • Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The...

    Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...

  • Can you please show how you found the last 5 columns of the first spreadsheet. thank...

    Can you please show how you found the last 5 columns of the first spreadsheet. thank you. Stark Company has five employees. Employees paid by the hour earn $11 per hour for the regular 40-hour workweek and $16 per hour beyond the 40 hours per week. Hourly employees are paid every two weeks, but salaried employees are paid monthly on the last biweekly payday of each month. FICA Social Security taxes are 6.2% of the first $128.400 paid to each...

  • Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user...

    Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user for type of employee (hourly ("h"or "H") or management ("'m" or "M") If the employee is management: . get the annual salary get the pay period (weekly ("w" or "W"), bi-weekly ("b" or "B") or monthly ("m" or e compute the gross salary for the pay period (Divide annual salary by 52 for weekly, 26 for bi-weekly, and 12 for monthly) deduct from gross...

  • For the following employee, calculate Net Pay, showing all calculations. Province of Employment Québec Employer Bombardier...

    For the following employee, calculate Net Pay, showing all calculations. Province of Employment Québec Employer Bombardier Inc. Pay Frequency Bi-weekly Pay period ending date Aug 10, 2019 Employee Data: Name Michelle Robotize Position Financial Manager Birth Date August 20, 1974 Pay Rate $26.50 per hour TD1 Claim Code 1 TP-1015.3-V Deduction Code A Year-to-date Québec Pension Plan contributions - $844.00 Year-to-date Employment Insurance premiums - $357.45 Year -to-date Québec Parental Insurance Plan premiums - $ 47.31 Other Information: For this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT