Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need some help with this, and would want to do it as short and simple as possible. Write a Java program to perform the

I need some help with this, and would want to do it as short and simple as possible.

Write a Java program to perform the following task:

First define an Employee class which includes employees name, salary and hire date. The hire date contains three integers day, month and year. The Employee class contains methods to be able to access employees name, salary and hire date. An employee can be created from the Employee class in one of the three ways: name only; or name and salary only; or name, salary and hire date of the employee. Creating an employee without any information is not allowed.

Second, define a Supervisor class (subclass of the employee class). A supervisor is an employee with a year-end bonus and a status level: L for lower level manager and U for upper level position.

In the main method in your program, declare an array of to hold at least ten employees (called emp_ary) which will be used to hold employee records. Enter the following employee information according to the instruction

image text in transcribed a). Enter the first three records at the time these three employee objects (records) are created using the appropriate class constructor.

b). Enter the name for the fourth and fifth record at the time the employee object (record) is created using the appropriate class constructor, and then use class methods to enter salary and hire date information from keyboard after the employee objects are created.

c). Enter the remaining records of employee using the appropriate class constructor, and then use class methods to enter the rest fields (level and bonus) from keyboard.

d). Now calculate the average salary of these employees and print the average.

e) Sort the employee records by salary and print all employee records (name, salary and hire date as shown above) in descending order in salary.

f). Resort the records by the income (including bonus) and print the result in descending order in income.

Name Salary Hire Date Supervisor Level Bonus Lori Green Mary Spade Joe Smith Jeff Berger April Apple John Smith Ginny Fernandez Paul Fullerton 50,000 47,000 54,000 63,000 41,000 65,000 69,000 71,000 3/4/2000 11/2/2001 5/7/1999 8/2/1995 4/23/2002 6/30/2003 1/20/2001 2/27/2004 yes yes L U L 5,000 7,000 4,500 yes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions