Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedNEED 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.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago