Question
Design aPayRoll class that has data members for an employee's hourly pay rate and number of hours worked. The class should have member functions to
Design aPayRoll class that has data members for an employee's hourly pay rate and number of hours worked. The class should have member functions to set the hourly pay rate and number of hours worked and to calculate gross pay.
The main program should create an array of sevenPayRoll objects. It should contain two loops. The first loop should read the number of hours each employee worked and their hourly pay rate from a file and call class set functions to store this information in the appropriate objects.
The second loop should call a class function, once for each object, to return the employee's gross pay, and display it as follows. Attached to this assignment is a payroll.dat file that can be used for testing your program.
Sample Output:
You should have 1 .cpp file to turn in.
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