Implement the employee class and its three child classes

Assignment Help JAVA Programming
Reference no: EM13748673 , Length: 4

FRAMEWORK OF THE PROBLEM

Acme Corporation, a well-known international IT company, is developing a Java application to manage their human resources. Employees in the company belong to any of these three departments: management, engineering or administration, and may have different types of contracts: temporary, training or indefinite. The annual salary of each employee is calculated based on his/her department, type of contract and the number of years in the company.

The application consists in several Java files, described as follows.

First, the Employee class models a generic employee, which holds 4 attributes:
* name: the name of the employee, a String
* contract: the type of contract, an int (see below)
* years: number of years in the company, an int 
* department: department to which he/she belongs, a String

This class includes a constructor to initialize all the attributes and provides the access methods (getters and setters) for all of them. These access methods must check that only valid values are assigned; otherwise, an IllegalArgumentException with a descriptive message must be thrown.

Allowed values for the type of contract must be defined in three integers: TEMPORARY (0), TRAINING (1) and INDEFINITE (2). These constants must be used throughout the program instead of the specific integer values, for code reading purposes.

The Employee class must implement the following Employed interface, which includes one single method double getSalary() that returns the total salary of the employee:

public interface Employed {
double getSalary();
}

Finally the class must include a String toString() method that returns the description of the employee, in the following format:

<name>: <department> department, <type of contract> contract, <years> years in the company, salary of <salary> bitcoins

[The text between < > represents the actual values for a given employee, for instance, <name> indicates that the name of the employee must be printed]

Three classes, extending from Employee, model employees in each of the company departments.

1) The ManagementEmployee class represents an employee in the Management department. A manager always has an indefinite contract and his/her salary is based on a starting salary of 40 000 bitcoins plus 6 000 bitcoins for every year in the company. 

2) Similarly, the EngineeringEmployee class represents an employee in the Engineering department. The salary of an engineer starts with 25 000 bitcoins and is incremented in 2 500 bitcoins each complete year that he/she stays in the company.

3) Lastly, the AdministrationEmployee class represents an employee in the Administration department. These employees are hired from employment agencies, so his/her contracts are always temporary and count as 0 years in the company. The salary is fixed, 18 000 bitcoins.

The current staff is made up of 6 employees:

* Bill, manager, 9 years in the company.
* Anna, engineering department, 9 years in the company, indefinite contract.
* John, engineering department, 5 years in the company, indefinite contract.
* Elizabeth, engineering department, 3 years in the company, training contract. 
* Michael, engineering department, 2 years in the company, training contract.
* Albert, administration.

The goal of this activity is to:

A) Implement the Employee class and its three child classes (ManagementEmployee, EngineeringEmployee and AdministrationEmployee), with all the necessary attributes and methods. Do not include any other attribute or method apart from the ones previously described.

B) Write a Staff class, which first creates an array with all the employees in the company, and then prints the complete staff list on the screen. This class must also calculate and print the total salary for each of the three departments.

The expected output of the Staff class is as follows:

- Bill: Management department, indefinite contract, 9 years in the company, salary of 94000.0 bitcoins 
- Anna: Engineering department, indefinite contract, 9 years in the company, salary of 47500.0 bitcoins
- John: Engineering department, indefinite contract, 5 years in the company, salary of 37500.0 bitcoins
- Elizabeth: Engineering department, training contract, 3 years in the company, salary of 32500.0 bitcoins
- Michael: Engineering department, training contract, 2 years in the company, salary of 30000.0 bitcoins
- Albert: Administration department, temporary contract, 0 years in the company, salary of 18000.0 bitcoins

MANAGEMENT TOTAL SALARY: 94000.0 bitcoins
ENGINEERING TOTAL SALARY: 147500.0 bitcoins
ADMINISTRATION TOTAL SALARY: 18000.0 bitcoins
ACME TOTAL SALARY: 259500.0 bitcoins

Reference no: EM13748673

Questions Cloud

Write a review of understanding iconography multimedia : Write a review of Understanding Iconography multimedia. A brief explanation of the four roles of the artist and An explanation of why your work exemplifies one specific role.
Evaluating current global leadership development programs : Evaluating current global leadership development programs for their effectiveness in fostering deep self-awareness and growth as well as cultural intelligence and multi-mindedness (Five Minds).
Same basic equation as the production budget : True of False. The Direct Materials uses the same basic equation as the production budget (i.e needs for this period + Desired for next period - beginning inventory = Amount to make or buy.
Prepared the estimated balance sheet : Near the end of 2013, the management of Simid Sports Co. , a manufacturing company prepared the following estimated balance sheet for December, 31 2013.
Implement the employee class and its three child classes : Implement the Employee class and its three child classes (ManagementEmployee, EngineeringEmployee and AdministrationEmployee), with all the necessary attributes and methods.
Used to eliminate or reduce gain recognition : Jonathan has owned and operated a golf driving range for a number of years. The sole proprietorship has been successful and grown to the point where it now also offers golf lessons and sponsors tournaments and other activities.
Evaluate a current development program : Evaluate a current development program you might create or in which you participate, relative to its ability to build deep self-awareness and growth, cultural intelligence, and Gardner's Five Minds in prospective leaders.
Projection of expenses : Question 1: Projection of expenses can begin after completing _________ assumptions.
Gross profit margin for each product produced based : ATC 5-1 (PG. 246) Using ABC to improve product pricing) Answer the four questions posed in the case. Include in your answer the basic differences between volume based (traditional) overhead application procedures and the ABC method. Determine the gro..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Write a java that reads from the user annual income

Write a Java program (name it IncomeTax) that reads from the user annual income as  integer value.

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  It should have an if statement

The following are hints given: It should have an if statement. This add method determines what number greater than or less than the other number, than it adds the positive or negative. I think this should be a private method.

  What are the benefits of documenting

What are the benefits of documenting our programs in Java?

  Illustrate how to create a bufferedinputstream

What are Buffered Input / Output Streams and why are they used - write some Java code to illustrate how to create a BufferedInputStream.

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

  Write the complete code for a public java class

Write the complete code for a public Java class called Change Machine that can hold nickels, dimes and quarters. Include a private instance variable to hold each type of coin that the machine hols.

  Data streams and how are they used to facilitate storage

What are Java data streams and how are they used to facilitate storage and retrieval of persistent objects?

  Write a method called alldigitsodds that returns whether

write a method called alldigitsodds that returns whether every digit of a positive integer is odd. return true if the

  Write an application that extends jframe

Write an application that extends JFrame and that displays a phrase in every font size from 6 through 20.

  Write a program cmsc401 java

Write a program cmsc401.java that receives a sequence of commands (from 1 up to 10000 commands)

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