Question: CIT 1 2 0 : Computational Thinking Chapter 1 0 : Objects Create an Employee object that contains the employee's first name, last name, address,
CIT : Computational Thinking
Chapter : Objects
Create an Employee object that contains the employee's first name, last name, address, phone, and
hourly pay rate. The Employee object should contain all of the required methods default constructor,
nondefault constructor, setter methods, getter methods, and toString method as well as a helper
method called calculatePay The calculatePay method should accept the number of hours worked as
a parameter and return how much the employee should be paid for that week. Anything over hours
is considered overtime and should be paid time and a half.
After the Employee object is created, write a driver program that will hold information about
employees. Get the employees' information from the user. Then display all of the employees' first and
last names as well as how much they should be paid for the week, use the getter methods and the
helper method to display this data do not format your toString method to return this data, the
toString method should still return all information entered about the employee
HINTS:
In your driver program:
You will need a loop to load the array, and another to print the "paychecks".
You will need to use parallel arrays to complete this assignment, one to hold the
employee objects and another to retain the number of hours worked for each
employee so that you can pass the hours worked to the calculatePay method in the
loop to print the "paychecks".
For your object:
Employee
firstName : String
lastName: String
address: String
phone: String
hourlyPayRate: double
setFirstName firstName : String : void
setLastName lastName : String : void
setAddress address: String : void
setPhoneNumber phone: String : void
setHourlyPayRate payRate : double : void
getFirstName : String
getLastName : String
getAddress : String
getPhoneNumber :String
getHourlyPayRate : double
calculatePay hoursWorked : int : double
toString :String
UML Diagram provided as a hint,
you are not required to use the
same names.
Make sure your program is fully documented and contains a comment block at the beginning with
your name, date, and purpose of program. Use meaningful variable names. Use indentation and
spacing within the program to improve readability. Make sure you test the program thoroughly.
Also do this in pseudocode
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
