Find Jobs
Hire Freelancers

Basic C++ Programming Challenge

$10-30 USD

In Progress
Posted about 10 years ago

$10-30 USD

Paid on delivery
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.
Project ID: 5349188

About the project

Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
United States
0.0
0
Payment method verified
Member since Jan 22, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.