Construct a class definition to represent an employee of a company. Each employee is defined by...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
include using namespace std class Employee private int ID double payrate ... View the full answer
Related Book For
Quantitative Methods for Business
ISBN: 978-0324651751
11th Edition
Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey cam
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Mike has the following monthly information: Salary $4,000 Rent 1,800 700 Car payment Investment Income 200 Meals 900 Groceries 700 Student Loan Payment 400 Other Expenses 600 1. What is Mike's...
-
Suppose you are a member of a congressional committee that is determining the type of crime that can be punishable by death. What kinds of cases, if any, would you put on the list? The killing and...
-
What is the difference between a change in the quantity supplied of Real GDP and a change in short-run aggregate supply?
-
What is the difference between a Mode and a State?
-
Chavez Concrete Inc. has two production departments. Blending had 1,000 units in process at the beginning of the period, two-fifths complete. During the period 7,800 units were received from Mixing,...
-
How do neurobiological mechanisms, such as the stress response system and emotional regulation pathways, influence the dynamics of conflict escalation and resolution?
-
Your firm has decided to try two approaches to estimating a valuation allowance for sales returns. Required: a. First, your firm decides to estimate that 10% of all sales will eventually be returned....
-
At Simba Travel Agency, the price of a climbing trip to Mount Kilimanjaro includes an initial fee plus a constant fee per meter. F(d)models the fee (in dollars) for climbing d meters. F(d)=110+0.12d....
-
Take the procedural design approach and create first the context diagram, and then the highest - level data flow and control - flow diagrams for an electronic lock in the laboratory door having the...
-
Suppose that, in order to protect Ronaldo from his adoring fans, soccer teams that host Real Madrid must hire extra security, and security costs go up as the number of fans at the game goes up. When...
-
N.B. Vargaftik 3 (1975) lists the experimental values in the following table for the enthalpy departure of isobutane at 175C. Compute theoretical values and their percent deviations from experiment...
-
Suppose the can segment their fans into young fans and senior citizens. Young fans have the demand curve 120 10G (MR = 120 20G). Senior citizens have the demand curve p = 60 10G (MR = 60 20G)....
-
Recent research in thermodynamic perturbation theory suggests the following equation of state. (a) Derive the departure function for (A A ig ) T,V . (b) Derive the departure function for (U U ig )....
-
For numbers 23-25, refer to the problem. There are one thousand tickets that are sold for P50.00 each. One ticket will win P10,000.00, two tickets will win P5,000.00 and three tickets will win...
-
Phosgene, COCl2, is a toxic gas used in the manufacture of urethane plastics. The gas dissociates at high temperature. At 400oC, the equilibrium constant Kc is 8.05 104. Find the percentage of...
-
The ONeill Shoe Manufacturing Company will produce a special-style shoe if the order size is large enough to provide a reasonable profit. For each special-style order, the company incurs a fixed cost...
-
Electric power consumption is measured in kilowatt-hours (kWh). The local utility company has an interrupt program, whereby commercial customers who participate receive favorable rates but must agree...
-
A quality control specialist has sampled 25 widgets from the production line. A widget can have minor or major defects. Of the 25 sampled widgets, 4 have minor defects and 2 have major defects. What...
-
In the freight car system shown in Fig. 6.14, the first car acquires a velocity of \(\dot{x}_{0}\) due to an impact. Find the resulting free vibration of the system. Assume \(m_{i}=m(i=1,2,3)\) and...
-
Find the free-vibration response of the three-degree-of-freedom airplane model considered in Problem 6.10 for the following data: \(m=5000 \mathrm{~kg}, l=5 \mathrm{~m}, E=7 \mathrm{GPa}, I=8 \times...
-
Using modal analysis, determine the free-vibration response of a two-degree-of-freedom system with equations of motion \[2\left[\begin{array}{ll}1 & 0 \\0 & 1\end{array} ight]...
Study smarter with the SolutionInn App