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 an application for kochs cottages

Create an application for Koch's Cottages, a weekend getaway resort that rents boats and cottages to use on the local lake.

  Write a program which adds two matrices

Write a program which adds two matrices together and displays the sum - Two arrays will contain user input, and the third array will be used to contain the sum of the two arrays.

  A program called invoice that will prompt the user for items

write a program called invoice that will prompt the user for items on and invoice and then print the total of the invoice

  Write an expression that concatenates the string variable

Write an expression that concatenates the string variable suffix onto the end of the string variable prefix.

  Create a constructor in the subclass why

Assume there is a base class with multiple constructors, if the subclass inherits from the base class, do we need to create a constructor in the subclass? Why?

  Design and implement a small and simple email server

Design and implement a small and simple email server using the concept of web based information system (WBIS).

  Write down a java program that implements a stack of

write a java program which implements a stack of integers. an integer should only be pushed into the stack if it is

  Write a program that reads in a text file and then computes

Write a program that reads in a text file and then computes and prints a table of letter frequencies. For example, if the file is the text of "A Tale of Two Cities", found in the file at data/tales.txt , the program will print

  Videorental store operatorrecord clients

Project is to design a program to help a videorental store operatorrecord clients' transactions - Design a primitive database indicating

  Write a method reversefirstk

Write a method reverseFirstK that accepts an integer k and a queue of integers as parameters and reverses the order of the first k elements of the queue, leaving the other elements in the same relative order.

  Write a class encapsulating a pc-based game

Write a class encapsulating a PC-based game, which inherits from Game. A PC-bases game has the following additional attributes: the minimum megabytes of RAM needed to play the fame, the number of megabytes needed on the hard drive to install the fame..

  What are some debugging techniques for javascript

What are some common programming errors? How can they be prevented? What is the try catch structure, how is it useful? What are some debugging techniques for JavaScript?

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