Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have this done in Java please and accommodate for the different employees. Thanks TASK: You want to develop a Java program that will allow you

image text in transcribedimage text in transcribedimage text in transcribed

Have this done in Java please and accommodate for the different employees. Thanks

TASK: 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 is stored for each type of employee. Create a NetBeans project using the following naming convention: The project name will: - Start with the assignment prefix, in this case Lab101. - The prefix is followed by a dash character - The dash is followed by your last name - Your last name is followed by your first initial - Your first initial is followed by your middle initial - For example, for this assignment my project would be named Lab101-LatimerJB - Note, no student should turn in a project named Lab101-LatimerJB 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 list. - The Hourly class is a subclass of Employee and contains only those fields that are specific to the Hourly entries in your employee list. - Each of these classes contains all of the "normally expected" methods. The "normally expected" methods are: - At least one constructor that is an overload constructor that includes all of the necessary information to create an 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 employees - Note that you determine these totals by counting the number of times the respective constructors have been called. Create a fourth class named Client that will be used to test your other classes. In this Client class: - This class must include the main method - In the main method - Create an array named employeeList of type Employee with a length of 10 - Populate the employeeList array with the following records by creating an appropriate instance of either the Salaried or Hourly class for each employee and then add the instance to the array. The employees should be added to the employeeList array in the order that they are listed, i.e. Al should be at index 0 , Kelly should be at index 1, etc. - A salaried employee named Al who is the Manager and is paid $60,000 per year. - An hourly employee named Kelly who is a Hostess and is paid $25.75 per hour. - A salaried employee named Peggy who is the CEO and is paid $120,000 per year. - An hourly employee named Bud who is a Busboy and is paid $15.00 per hour. - An hourly employee named Marcy who is a Server and is paid $10.00 per hour. - An hourly employee named Jefferson who is a Cook and is paid $35.00 per hour. - Once you have populated the array - print out the contents of the array using a for loop. - Hint - just call the toString( ) method to print the contents of an instance. - This loop should print out the contents of every entry in the array including the blank (null) entries. - Now give everyone in the employeeList array a 25% raise. - When applying the raises use a loop to step across the array. - Your code must dynamically determine the type of employee at each array location by using the instanceof operator (i.e. your code should correctly apply raises regardless of the order in which the employees are entered into the array). - After you have given everyone a 25% raise: - Print out the contents of the array using a for loop. - This time do not print the blank (nuil) entries. - Your code must dynamically determine if an entry is null and not print out the null entries. - Finally, explicitly test the equals methods for each of your classes. - This will require four tests. - Show at least one test where the equals( ) method retums true and one test where the equals( ) method returns false for the Hourly class. - Show at least one test where the equals() method retums true and one test where the equals( ) method returns false for the Salaried class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions