Question
Java Homework Help: Book is Data Structures and Algorithms You want to develop a Java program that will allow you to keep track of a
Java Homework Help: Book is Data Structures and Algorithms
You want to develop a Java program that will allow you to keep track of a set of employees. In reviewing your employee list, you notice that your employees fall into two categories: Salaried and Hourly. The following table shows the information that you keep in your employee list for each type of employee.
Field | Type | Salaried | Hourly |
id | int | Yes | Yes |
name | String | Yes | Yes |
title | String | Yes | No |
position | String | No | Yes |
salary | int | Yes | No |
hourlyRate | double | No | Yes |
Create a NetBeans project named Lab101
In this project create three classes named Employee, Salaried and Hourly such that:
The Employee class contains all of the fields common to both types of entries in your employee list.
The Salaried class is a subclass of Employee and contains only those fields that are specific to the Salaried entries in your employee book.
The Hourly class is a subclass of Employee and contains only those fields that are specific to the Hourly entries in your employee book.
Each of these classes contains all of the normally expected methods.
At least one constructor that is an overload constructor that includes all of the necessary information to create a instance.
A getter and setter (accessor and mutator) method for each instance/class variable
A toString method
An equals method
Create your classes so that you can keep track of the
Total number of Employees
Total number of Salaried employees
Total number of Hourly emplooyees
Create a fourth class name Client that will be used to test your other classes. In the Client class:
This class must include the main method
Create an array employeeList of type Employee of length 10
Add a minimum of three Salaried contacts to the array
Add a minimum of three Hourly employees contacts to the array
Data for each of the contacts must be entered from the keyboard.
The employee types must NOT be grouped, i.e. the salaried employees should be interleaved with the hourly employees.
Once you entered the data for the six employees:
print out the contents of the array using a loop.
This loop should print out the contents of every entry in the array including the blank (null) entries.
Now give everyone in the employeeList a 10% raise.
When applying the raises use a loop to step across the array.
After you have given everyone a 10% raise:
Print out the contents of the array using a loop.
This time do not print the blank (null) entries.
Explicitly test the equals methods for each of your classes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started