Write a C++ program as follows, 1. Create a class called Employee that includes attributes: empid (int), name (string), points (double), group (string), and avg (double) respectively. 2. include a constructor with parameters: empid and name. 3. include another constructor to assign default values to the attributes. 4. include a function called addPoints that is used to add a given amount to the value of the attritute (points). 5. include a function called upgradePoints that is used to increase the value of the attribute (points) by a given percentage. 6. include a function called removePoints that is used to reduce a given amount from the value of the attribute (points). if the resultant value is negative then the value of the attribute (points) should be set into zero. 7. include a function called computeGroup that assign a value to the attribute (group) based on the value of the attribute (points) as given in the following table. attribute (points) attribute (group) point<100 Silver 100<=points<500 Gold 500

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a C++ program as follows,

1. Create a class called Employee that includes attributes: empid (int), name (string), points (double), group (string), and avg (double) respectively.

2. include a constructor with parameters: empid and name.

3. include another constructor to assign default values to the attributes.

4. include a function called addPoints that is used to add a given amount to the value of the attritute (points).

5. include a function called upgradePoints that is used to increase the value of the attribute (points) by a given percentage.

6. include a function called removePoints that is used to reduce a given amount from the value of the attribute (points). if the resultant value is negative then the value of the attribute (points) should be set into zero.

7. include a function called computeGroup that assign a value to the attribute (group) based on the value of the attribute (points) as given in the following table.

attribute (points) attribute (group)
point<100 Silver
100<=points<500 Gold
500<points<=2000 Platinum
2000<points

Diamond

8. Include a function called (display) to display the values of all the attributes of a Employee object.

9. Include a static function called getBest that returns the value of the attribute (id) of the Employee with maximum number of points.

10. Create an array in main function that holds five Employee (class) objects. assign the objects given in the following table to each array element using the parameterized constructor. 

Attribute Object [0] Object [1] Object [2] Object [3] Object [4]
id 1543 6561 6954 3485 8546
name Adil Waseem Ayesha Adnan Wajid

11. Use the function addPoints to add following points respectively to each Employee object created above.

129 785 3258 59 1652

12. Add extra 1000 points to the third Employee object using the function addPoints.

13. Increase the points of the second Employee object by 2% using the function upgradePoints.

14. Include a function called display that displays all the attributes of each Employee object. Each set of attributes should be separated by a sequence of dots. The part of ouput for the first Employee object is given below

Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY