Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions