Question

In: Computer Science

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

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

Solutions

Expert Solution

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

    }
}

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


Related Solutions

You are a renowned software developer and you have been hired by an old British boyband...
You are a renowned software developer and you have been hired by an old British boyband that wants to make a comeback in the industry. They ask you to make an app to showcase their new music and events. In your implementation, you have a class for each of the 5 group members, but you find that compiling each band member’s class takes more time than you currently have. Luckily, you remember that you learned about Makefiles in your favorite...
As a small software developer firm, you have approached the AXZ Bank to obtain a term...
As a small software developer firm, you have approached the AXZ Bank to obtain a term loan so that the firm can purchase a new server. The AXZ bank provides two (2) offers to your company, as listed below: a) a loan of $100,000 over a five (5) year period at an interest rate of 7.65% per annum (per year) payable at the end of each month. b) a loan of $100, 000 over a three (3) year period at...
As a small software developer firm, you have approached the AXZ Bank to obtain a term...
As a small software developer firm, you have approached the AXZ Bank to obtain a term loan so that the firm can purchase a new server. The AXZ bank provides two (2) offers to your company, as listed below: a) a loan of $100,000 over a five (5) year period at an interest rate of 7.65% per annum (per year) payable at the end of each month. b) a loan of $100, 000 over a three (3) year period at...
1. Suppose that a software developer is creating a program to store lists of supermarket products....
1. Suppose that a software developer is creating a program to store lists of supermarket products. Each product has a code made up of the digits 0 and 1, for example 010011010000, and an availability, either yes or no. Further suppose that the software developer decides to store the lists in base-10, believing that base-10 will simplify calculations. Briefly explain why this is a bad idea.  
Suppose that a software developer is creating a program to store lists of supermarket products. Each...
Suppose that a software developer is creating a program to store lists of supermarket products. Each product has a code made up of the digits 0 and 1, for example 010011010000, and an availability, either yes or no. Further suppose that the software developer decides to store the lists in base-10, believing that base-10 will simplify calculations. Briefly explain why this is a bad idea.
You have received the following three payment options for a software application you have developed to...
You have received the following three payment options for a software application you have developed to sell: Option 1 You will receive $1,000,000 now plus $200,000 from year 6 through 15. Also, if the software application did over $100 million in cumulative sales by the end of year 15, you will receive an additional $3,000,000. There is a 70 percent probability this would happen. Option 2 You will receive thirty percent of the buyer’s gross profit on the product for...
You have received the following three payment options for a software application you have developed to...
You have received the following three payment options for a software application you have developed to sell: Option 1 You will receive $1,000,000 now plus $200,000 from year 6 through 15. Also, if the software application did over $100 million in cumulative sales by the end of year 15, you will receive an additional $3,000,000. There is a 70 percent probability this would happen. Option 2 You will receive thirty percent of the buyer’s gross profit on the product for...
Choice 1. You are the new software developer at work. You are brought into a meeting...
Choice 1. You are the new software developer at work. You are brought into a meeting with clients that do not understand the idea of sorting data. Now you know, that you cannot use complex math to explain, but you can illustrate in diagrams. Basically, this group has been working with unsorted data and you must explain why their searches and reports will be so much faster with sorted data. You do not know anything specific about their data, but...
What professional responsibilities does a software developer have with respect to the testing and documentation of...
What professional responsibilities does a software developer have with respect to the testing and documentation of code that he/she develops?
What professional responsibilities does a software developer have with respect to the testing and documentation of...
What professional responsibilities does a software developer have with respect to the testing and documentation of code that he/she develops? And Which aspects of testing and documentation would a developer normally not be involved in? Explain your answer.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT