Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Construct a class definition to represent an employee of a company. Each employee is defined by an integer ID number, a double-precision pay rate,
Construct a class definition to represent an employee of a company. Each employee is defined by an integer ID number, a double-precision pay rate, and the maximum number of hours the employee should work each week. The class should provide these functions: a default and parameterized constructors to set data for a new employee, a faction to set the data for a new employee, a function to get the data for a new employee, a function to display existing data for a new employee, and a function to compare two employees' data. Protect functions and objects as needed. Include the class definition in a working C++ program and create 3 objects; construct the first object by calling the default constructor and the second object by calling the constructor with parameters; ask the user to enter data for the third object; display the data of each employee and compare the data of the second and third employee. Please enter an id number for employee 3: 23456 Please enter the max hours for employee 3: 45 Please enter the pay rate for employee 3: 15 Data for employee 1: The ID number is: 0 The maximum hours worked is: 0 The pay rate is: 0 Data for employee 2: The ID number is: 23456 The maximum hours worked is: 36 The pay rate is: 10.25 employee 3 id = 23456 employee 3 pay = 15 employee 3 hrs = 45 employee 1 and employee 2 are not the same
Step by Step Solution
★★★★★
3.40 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
include using namespace std class Employee private int ID double payrate ...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