
Explanation of Solution
The errors are in the following lines:
class hourlyEmployee: public class employee - has the word “class” mentioned before the base class.
public:: - should be public:
void setHoursWorked(double hrsWk) const; - set functions should not be constant functions as they modify data members.
void setPay() const; - set functions should not be constant functions as they modify data members.
private; - should be private:
Hence the correct program is:
class hourlyEmployee: public employee
{
public:
void setData(string n = "", string d = "", int a = 0,
double p = 0, double hrsWk = 0,
double payRate = 0.0);
// Data members are set according to the parameters.
// Values assigned to numeric data is nonnegative.
void setHoursWorked(double hrsWk);
// Function to set hours worked.
// if hrsWk>= 0, hoursWorked = hrsWk;
// Otherwise hoursWorked = 0;
double getHoursWorked() const;
// returns the value of hoursWorked...

Want to see the full answer?
Check out a sample textbook solution
Chapter 11 Solutions
C++ Programming: From Problem Analysis to Program Design
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning




