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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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