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

  Consider a typical certification hierarchy

Why might Bob still not trust that the certificate for Alice truly establishes Alice as the owner of the public key in the certificate?

  Implement avl trees that allows both iterative traversal

implement avl trees that allows both iterative traversal and recursive traversal.iterative traversal is fairly easy if

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  The user is assumed to enter the list in sorted order

Make sure you FULLY test your program! Make sure to run your program multiple times, inputting combinations of values that will test all possible conditions for your IF statements and loops. Also be sure to test border-line cases.

  Write a java code that calculates the product

Write a java code that calculates the product of the subsequent sequence of numbers using for/loop and do/while/loop

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Write a recursive instance method

Write a recursive instance method

  Design a program that asks the user to enter a series of 20

Number Analysis Program: Design a program that asks the user to enter a series of 20 numbers

  Write a void method that takes as a parameter

Write a Point class. A Point should have the subsequent - Write a void method that takes as a parameter an array of Lines and prints out the location of each intersection. The intersection of any two lines should only be printed once

  Improve the efficiency of their operations

To help improve the efficiency of their operations, the Maitre De has hired you to write a program that simulates people waiting for tables. The goal is to determine the average amount of time people spend waiting for tables.

  Write a generic class

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

  Implement a generic class set

Implement a generic class Set that maintains a set of items of generic type T using the class LinkedList in the Java API. Your Set class must provide the subsequent functionality:

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