Ask Java Expert


Home >> Java

Develop a Java application to find out the monthly paychecks for a number of different types of employees. The employee types are created in a subclass array based on parent base class Employee. Initial code is provided for each class and for a driver class. 

You will need to compile each Java source file (provided below) separately, in its own file since they are public classes, to create a .class file for each, ideally keeping them all in the same directory. 

You should first compile and execute the original classes and then make your customer modifications for this program.

You should compile Date.java first, then Employee.java, then CommissionEmployee.java, then BasePlusCommission.java, then HourlyEmployee.java, then SalariedEmployee.java, and finally PayrollSystemTest.java. And maintain this compilation order when you make your customized modifications to these classes later.

As part of the modifications you need to make to the supplied code, you are to prompt the user for all the data that is now provided in the code for the class PayrollSystemTest (i.e. instead of using these values from their declaration in the code, get data from prompting the user for it, one value at a time). All program output, including prompts and results and all program input must be done from the PayrollSystemTest class. 

In addition you need to add a new private instance field "birthDate" to the Employee class. The "birthDate" field must be a Date data type, not a String! Add get and set methods to Employee class for this new birthDate field. The birthdate is to be displayed using a customized toDateString method in the Date class. 

The birthDate field must be determined from separate integer values, supplied by the user, for the birth month, day, and year. As with all other inputs, these three birth date components must be prompted from and input to class PayrollSystemTest. Once input, these three parameter values must then be supplied to the appropriate modified employee subclass constructor, and then the subclass constructors supply these three values to their parent class, a modified Employee class constructor. 

The single birthDate field of a Date data type must be declared and initialized in the Employee class.

In class PayrollSystemTest create an array of Employee variables to store references to the various employee objects. In a loop, find out the monthly paycheck amount for each Employee (polymorphically), and add a $100.00 bonus to the person's monthly payroll amount if the current month (i.e. November) is the month in which the Employee's birthday occurs.

Your program should input data and create the five employees below on the version of the program you submit for grading. Your program must find out their monthly salaries for November (assumed to be the "current" month). Assume that the monthly salary is simply four times the weekly salary.

a) one Salaried Employee with a weekly salary of $1000 and a birthday of January 1, 1960,
b) one Salaried Employee with a weekly salary of $1000 and a birthday in this month (November 1, 1961)
c) one Commission Employee Worker with a gross weekly sales of $12,000 and a 5% commission rate and a birthday of February 1, 1962, 
d) one Base Plus Commission Employee with a gross weekly sales of $10,000, a 3% commission, and a $500 base weekly salary with a birthday of March 1, 1963, and
e) one Hourly Employee with a wage of $20/hour working for 40 hours and a birthday of April 1, 1964

You should make up your own employee names for the five required employees above. Make sure you create the employees in the order above.

In prompting the user for all input values for the five employees above, your program 
essentially replaces the existing main() method of PayrollSystemTest.java. You may user whatever input class you want (e.g. JOptionPane, Scanner). Keep all other lines of the code in PayrollSystemTest as they are originally, including the code that gives a 10% increase to the Base Plus Commission employee. 

You will probably find it helpful to prompt for the worker type first. You may 
hardcode "November" as the special bonus month. 

Since the outputs are to be for monthly paychecks, just multiply the weekly 
salaries, weekly output quantities, and weekly hours by 4. Display your results 
for each worker's salary after all data for that employee type has been entered
and the salary determined.

Your output should appear like the ex below (using the current exs in the code for PayrollSystemTest (the "Employees processed individually" portion isn't shown, and monthly salaries are shown below as required by this program vs. weekly salaries that would be produced from the unmodified code). Note that the test data is shown below. Your five employees will create a different set of outputs.

Employees process polymorphically:

salaried employee: John Smith
social security number: 111-11-1111
date of birth: 01/02/1960(current code won't do this but yours must)
weekly salary: $800.00
earned $3200.00

hourly employee: Karen Price
social security number: 222-22-2222
date of birth: 01/02/1960(current code won't do this but yours must)
hourly wage: $16.75; hours worked: 40.00
earned $2680.00

commission employee: Sue Jones
social security number: 333-33-3333
date of birth: 01/02/1960(current code won't do this but yours must)
gross sales: $10,000.00; commission rate: 0.06
earned $2400.00

base-salaried commission employee: Bob Lewis
social security number: 444-44-4444
date of birth: 01/02/1960(current code won't do this but yours must)
gross sales: $5,000.00; commission rate: 0.04; base salary: $300.00
new base salary with 10% increase is: $330.00
earned: $2120.00

Employee 0 is a SalariedEmployee
Employee 1 is a HourlyEmployee
Employee 2 is a CommissionEmployee
Employee 3 is a BasePlusCommissionEmployee 

Java, Programming

  • Category:- Java
  • Reference No.:- M986226

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As