Write an employee payroll program

Assignment Help JAVA Programming
Reference no: EM13841552

The file must be called <Payroll.java> (driver program)

Employee.java

Hourly.java (which extends employee)

Salaried.java (which extends employee)

SalariedPlusCommission.java (which extends Salaried)

Ensure you include ALL files required to make your program compile and run.

I would like to see your .java files only.

Overall Requirements

Write an employee payroll program that uses polymorphism to calculate and print the weekly payroll for your company. There are three types of employees - hourly, salaried, and salaried plus commission. Each type of employee gets paid using a different formula. But for all employee types, if the calculated paycheck exceeds $1000, the actual paycheck must be decreased to $1000

Use this class hierarchy:

1221_Employee_payroll_program.jpg

Use the public access modifier for the toStringmethod in the Employee class and the load method in the Employee, Hourly, Salaried, and SalariedPlusCommission classes.

Employee.java class

Instance variables:

name

social security number

birthday month

birthday week

loadmethod :

Prompts the user for instance-variable values and loads the entries.

toStringmethod:

Returns a string that shows the employee's name, social security number, and paycheck.. Use the String.format method (See Java API documentation to help you format the string as shown in the sample session's paycheck report.) Here's an example from the sample session:

employee: Biff Sanchez

social security number: 111-11-1111

paycheck: $800.00

getBonusmethod:

Generates a $100 employee birthday bonus. Compare the employee's birthday with the current date found on your computer system. Use the Calendar class to generate the current date. (See Sun's Java API documentation.) If the employee's birthday month and birthday week match your computer system's current month and current week, then increment the employee's paycheck by $100. The birthdayMonth holds the month (1-12) in which the employee was born. The birthdayWeek holds the week (1-4) that the employee chooses to get paid his/her bonus.

Include a getEarningsmethod that is abstract.

Use the public access modifier for the toStringmethod to return a string version of the contents of the employee.

Hourly.java class

Instance variables:

hourly pay

hours worked during the past week

loadmethod:

Prompts the user for instance-variable values and loads the entries. Include a getEarningsmethod that calculates earnings for an hourly employee. Hourly employees are paid by the hour. If they work more than 40 hours in a week, then they receive overtime pay for their overtime work. Overtime pay equals one and a half times their normal hourly pay.

Salaried.java class

Instance variables:

Weekly salary

loadmethod:

Prompts the user for instance-variable values and loads the entries.

Include a getEarningsmethod that calculates earnings for a salaried employee. Salaried employees are paid their fixed weekly salary regardless of the number of hours they work.

SalariedPlusCommission.java class

Instance variables:

Sales during the past week commission rate

loadmethod:

Prompts the user for instance-variable values and loads the entries.

Include a getEarningsmethod that calculates earnings for a SalariedPlusCommission employee. SalariedPlusCommission employees are paid a base salary plus a percentage of their sales. "Percentage of their sales" equates to the product of their sales times their commission rate.

Use initially declared named constants instead of hardcoded "magic numbers" embedded in the program.

Provide a driver that generates the following queries and outputs.

Sample session (assuming current month = 10 and current week = 2):

Number of employees: 3

PROFILE FOR EMPLOYEE #1:

type Hourly(1), Salaried(2), Salaried plus Commission(3)

Enter 1, 2, or 3 ==>1

Name ==>Biff Sanchez

Social security number ==>111-11-1111

Birthday month (1-12) ==>2

Birthday bonus week (1-4) ==>3

Hourly pay ==>20

Hours worked this past week ==>30

PROFILE FOR EMPLOYEE #2:

type Hourly(1), Salaried(2), Salaried plus Commission(3)

Enter 1, 2, or 3 ==>2

Name ==>Dirk Jones

Social security number ==>222-22-2222

Birthday month (1-12) ==>10

Birthday bonus week (1-4) ==>2

Salary ==>700

PROFILE FOR EMPLOYEE #3:

type Hourly(1), Salaried(2), Salaried plus Commission(3)

Enter 1, 2, or 3 ==>3

Name ==>Suzie Que

Social security number ==>333-33-3333

Birthday month (1-12) ==>7

Birthday bonus week (1-4) ==>3

Salary ==>400

Sales for this past week ==>2000

Sales commission rate (fraction paid to employee) ==>.25

PAYCHECK REPORT:

employee: Biff Sanchez

social security number: 111-11-1111

paycheck: $600.00

employee: Dirk Jones

social security number: 222-22-2222

paycheck: $800.00

employee: Suzie Que

social security number: 333-33-3333

paycheck: $900.00

Reference no: EM13841552

Questions Cloud

Identifies the transitions between acts : Identifies the transitions between acts. Identifies and justifies elements of the hero's journey within the films. Describes how the use of the hero's journey was effective in the movie (or how it was not)
Establish enterprise objectives for selected system : Establish enterprise objectives for selected system. Obtain a copy of the organisational chart of the enterprise for which you work. If one does not exist, draw one up.
Briefly describe the company and its products : Briefly describe the company and its products. Explain why did they succeed. What lessons can we learn from the case
How to succeed in public speaking : Topic: How to Succeed in Public Speaking. Tie to the Audience: All of you here today are currently enrolled in CA 110 Public Speaking, and I am sure you would like to successfully complete the course, as well as learn new ways to address an audienc..
Write an employee payroll program : Write an employee payroll program that uses polymorphism to calculate and print the weekly payroll for your company. There are three types of employees - hourly, salaried, and salaried plus commission. Each type of employee gets paid using a diffe..
The firm manufactures a global positioning system : The firm manufactures a global positioning system (GPS) that sells for $2,000, with cost of goods sold (hardware 30% and software 70%) of 55% of sales. Compared to the United States, China offers a 7% cost reduction in electronics manufacturing hardw..
Why is knowing the product demand so crucial : Why is knowing (or estimating) the product demand so crucial for a firm
Explain how the vietnam war finally ended : Explain how the Vietnam War finally ended
How does it relate to the market failing : What the article is about and how does it relate to the market failing. What thoughts the article provoked

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Write a script that prints out the full pathnames

Write a script that prints out the full pathnames of your files that are over a specified size.  The size should beread as a command line argument to the script.

  Write complete java program assuming that the variables gpa

Write a complete java program assuming that the variables gpa, studentName and deanList have been declared, you should read in the gpa and studentName from keyboard.

  Create application uses two-dimensional arrays

Create an application which uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes.

  Write a generic class called pair that stores two values

Write a generic class called Pair that stores two values of the generic type. It should have a constructor to set them, two methods getfirst()

  Redesign the grading program as an object-oriented design

redesign the grading program as an object-oriented design. We will start with a simple Student class. The student will have a name, an id (as a String) and a set of grades (as doubles)

  Implement the finite field gf

Write a program called "GF2.java" to implement the finite field GF(p n )where p is a prime number andn is a positive integer.You also need to write four methodsto realize.

  Create a driver class with a main method

Create a driver class with a main method that creates a course, adds several students, prints a roll, and prints the overall course test average

  Write a program that reads in the file

Write a program that reads in the file and exports it to a standard CSV format. For the records above, the output format would be Freddy Kruger, 1313 Mockingbird Lane, Houston, Texas Billy Thornton, 1010 Slingblade Street, Houston, Texas

  Write a java program that reads unspecified number

Write a java program that reads unspecified number of integers (the input 0 signifies the end of the input). Calculates and displays the sum and the average of the input value (not counting zero). The program also finds the maximum and minimum of ..

  Write a java servlet to validate the data

Write a Java Servlet to validate the data submitted through the above registration page. If the required fields are empty relevant error messages should be displayed on the same registration page.

  Creates an array named odds

Write code that creates an array named odds and stores all odd numbers between -6 and 38 into it using a loop. Make the array's size exactly large enough to store the numbers.

  Design and implementation of a hangman game

Design and Implementation of a Hangman game

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd