Create a class called consultCo that holds a private class called employee that
ID: 3679175 • Letter: C
Question
Create a class called consultCo that holds a private class called employee that contains the name, pay rate and social security number of an employee of a consulting firm called consultCo. The consultCo class should also have an array that holds all of the objects of all of the employees in the array. This will be an array of employee objects.
Here is a logical diagram of this array of objects:
You will also need methods to satisfy the following requirements:
Minimum Requirements:
An add method to hire a new employee. This method should create a new object with the employee information (name, payrate and social security number) and then it should add that new object to the array. You are not required to update an employee’s data if the employee exists. (5 points)
A report method that will display the name, pay rate and social security number of all employees. (5 points).
A raise method that will give all employees a 10% raise. (5 points).
You will also need a main method that creates calls the method(s) you created to meet the requirements of this project (5 points).
Notes:
You will need at a minimum two (2) classes for this project: the public class that contains the main method and a class that is a private class that is a member of another class. If you would like to include more than 2 classes, that is fine but not required.
The Module Lab Activities "Lookup!" and/or "Lookup! With GUI" (a GUI is great but not required) can be extremely helpful for this project. Just by following the lab activity (and the video demos if needed), you can make significant progress toward completing this assignment.
Explanation / Answer
Please find the required code and output below :
---------------------------
OUTPUT :
Employee{name='Emp 1', payrate=10.5, socialSecurityNumber=212424}
Employee{name='Emp 2', payrate=12.4, socialSecurityNumber=882622}
Employee{name='Emp 3', payrate=80.0, socialSecurityNumber=963712}
Employee{name='Emp 1', payrate=11.55, socialSecurityNumber=212424}
Employee{name='Emp 2', payrate=13.640000000000002, socialSecurityNumber=882622}
Employee{name='Emp 3', payrate=88.0, socialSecurityNumber=963712}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.