Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NEED IN C++ not java/python or any other language. Design a PayRoll class that has data members for an employee's hourly pay rate, number of
NEED IN C++ not java/python or any other language.
Design a PayRoll class that has data members for an employee's hourly pay rate, number of hours worked of type double. The default constructor will set the hours worked and pay rate to zero. The class must have a mutator function to set the pay rate for each employee and hours worked. The class should include accessors for both the hours worked and the rate of pay. The class should lastly have a getGross function that will return a double calculated by multiplying the hours worked by the rate of pay Write a program with an array of seven PayRoll objects. The program should ask the user for the rate of pay for each employee and the number of hours each employee has worked. Be sure to include an employee claiming to work more then 60 hours per week. Print out, the array number of the employee, the hours worked, the rate of pay, and the gross pay, of all the employee's each on their own line. Set the precision for printing the doubles to two decimal places. Input Validation: Do not accept values greater than 60 for the number of hours worked, simply have the set function set number of hours worked to 60, the maximum allowed Input Validation: Do not accept values greater than 60 for the umber of hours worked. Sample Ouput Enter the hours worked and pay rate for 7 employees: Employee #1 pay rate: 15 Employee #1 hours worked: 40 Employee #2 pay rate: 20 Employee #2 hours worked: 35 Employee #3 pay rate: 18 Employee #3 hours worked: 40 Employee #4 pay rate: 22 Employee #4 hours worked: 38 Employee #5 pay rate: 15 Employee #5 hours worked: 40 Employee #6 pay rate: 20 Employee #6 hours worked: 32 Employee #7 pay rate: 22 Employee #7 hours worked: 40 Total pay Employee #1: 600.00 Employee #2: 700.00 Employee #3: 720.00 Employee #4: 836.00 Employee #5: 600.00 Employee #6: 640.00Step 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