Write the following program in C++

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write the following program in C++

Create a class called Employee that includes attributes: empid, name, points,
group, and avg with data types: “int”, “String”, “double”, “String”, and “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 attribute 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 should be set into zero.
7. Include a function called computeGroup that assigns a value to the attribute group based on the value of the attribute points as given in the following table.

Points Group
points < 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 objects. Assign the objects given in the following table to each array element using the parameterized
constructor.

Attributes obj[0] obj[1] obj[2] obj[3] obj[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 using the function addPoints.
13. Increase the points of the second employee by 2% using the function
upgradePoints.

14. call the function display

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education