1) Design a PayRoll class that has data members for an employee's hourly pay rate and number of hours worked. Write a program with an array of seven PayRoll objects. The program should read the number of hours each employee worked and their hourly pay rate from a file and call class functions to store this information in the appropriate objects. It should then call a class function, once for each object, to return the employee's gross pay, so this information can be displayed. Sample data to test this program can be found in the [login to view URL] file.
Class is provided below:
class Payroll
{
private:
double payRate;
// holds an employee hourly pay rate
double hoursWorked;
// an employee's hours worked
public:
Payroll();
// empty constructor sets the payRate and
hoursWorked to zero
Payroll(double payR, double hoursW); //constructor checks for payR and hoursW to be positive
// and sets payRate and hours worked; sets to zero if negative values are provided
void setPayRate(double payR); //mutator for payRate; checks for payR to be positive or sets to zero
void setHoursWorked(double hoursW); //mutator for hoursWorked; checks for positive hoursW or sets to zero
double getPayRate(); //accessor to return payRate
double getHoursWorked(); // accessor to return hoursWorked
double getGrossPay(); // computes and returns gross pay including OVERTIME, if any
};
// Provide all member function implementations after this point.