Q2: Replacement is a very generous institute that provides a Bonus monthly salary to their employees in each month of every second year i.e., a bonus salary for one complete year. The lowest paid employee gets Bonus amount equal to 8% monthly salary of highest paid employee. The second lowest paid gets Bonus equal to 8% monthly salary of second highest paid employee and so on. In each month of second year the Bonus percentage increases with the rate of 2% a month means in next month bonus will be 10% of actual salary of corresponding employee and so on. Following are compulsory in your program. 1. Create a private pointer data member (salary=new double) to the salary of each employee. 2. Create an array of objects for 10 Employees Employee e[10] and assign initial salary using the setter function. 3. Implement a member function "Temporary" to declare and initialize an array of static Special Instances SI[10] of Employee class, to get a copy of e[10] objects using copy constructor. Make sure to apply the knowledge of deep copy here. Return the pointer to pointer array Employee *SI[10]. Use this array of objects to hold updated salary in the required function. 4. Implement a global friend function "Calculate" to compute and update the salary for Bonus month January for the desired employee when it is called the first time. Use the array of object SI[10] for calculating the updated salary. This SI[10] already has a copy of actual salary and now use it along with e[10] for finding the updated salaries of bonus months and store the update salary in SI[10] only. Next call to this same function must repeat the same operation to calculate Bonus salary of February of the desired employee. Calling this function 13th time will repeat the same operation for the month January of the desired employee. Maintain a sequence of function call for any desired employee. You may use static keyword where it is required but it is not compulsory. Call this function by passing both Employee e[10] and Employee *SI[10]. Remember, there is no getter() function to access the private data member salary, therefore a friend function is required. 5. Implement a function to print the salary of required employee for any month including bonus in the sequence of function call. This function can further call the friend function for calculations. 6. Assume two employees cannot have same salaries. 7. Use sorting instead of hard coding the below chart.

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

URGENT HELP PLEASE

Q2: Replacement is a very generous institute that provides a Bonus monthly salary to their
employees in each month of every second year i.e., a bonus salary for one complete year. The
lowest paid employee gets Bonus amount equal to 8% monthly salary of highest paid employee. The
second lowest paid gets Bonus equal to 8% monthly salary of second highest paid employee and so
on. In each month of second year the Bonus percentage increases with the rate of 2% a month
means in next month bonus will be 10% of actual salary of corresponding employee and so on.
Following are compulsory in your program.
1. Create a private pointer data member (salary3Dnew double) to the salary of each employee.
2. Create an array of objects for 10 Employees Employee e[10] and assign initial salary using
the setter function.
3. Implement a member function "Temporary" to declare and initialize an array of static
Special Instances SI[10] of Employee class, to get a copy of e[10] objects using copy
constructor. Make sure to apply the knowledge of deep copy here. Return the pointer to
pointer array Employee *SI[10]. Use this array of objects to hold updated salary in the
required function.
4. Implement a global friend function "Calculate" to compute and update the salary for Bonus
month January for the desired employee when it is called the first time. Use the array of
object SI(10] for calculating the updated salary. This SI[10] already has a copy of actual salary
and now use it along with e[10] for finding the updated salaries of bonus months and store
the update salary in SI[10] only. Next call to this same function must repeat the same
operation to calculate Bonus salary of February of the desired employee. Calling this
function 13th time will repeat the same operation for the month January of the desired
employee. Maintain a sequence of function call for any desired employee. You may use
static keyword where it is required but it is not compulsory. Call this function by passing
both Employee e[10] and Employee *SI[10]. Remember, there is no getter() function to
access the private data member salary, therefore a friend function is required.
5. Implement a function to print the salary of required employee for any month including
bonus in the sequence of function call. This function can further call the friend function for
calculations.
6. Assume two employees cannot have same salaries.
7. Use sorting instead of hard coding the below chart.
Transcribed Image Text:Q2: Replacement is a very generous institute that provides a Bonus monthly salary to their employees in each month of every second year i.e., a bonus salary for one complete year. The lowest paid employee gets Bonus amount equal to 8% monthly salary of highest paid employee. The second lowest paid gets Bonus equal to 8% monthly salary of second highest paid employee and so on. In each month of second year the Bonus percentage increases with the rate of 2% a month means in next month bonus will be 10% of actual salary of corresponding employee and so on. Following are compulsory in your program. 1. Create a private pointer data member (salary3Dnew double) to the salary of each employee. 2. Create an array of objects for 10 Employees Employee e[10] and assign initial salary using the setter function. 3. Implement a member function "Temporary" to declare and initialize an array of static Special Instances SI[10] of Employee class, to get a copy of e[10] objects using copy constructor. Make sure to apply the knowledge of deep copy here. Return the pointer to pointer array Employee *SI[10]. Use this array of objects to hold updated salary in the required function. 4. Implement a global friend function "Calculate" to compute and update the salary for Bonus month January for the desired employee when it is called the first time. Use the array of object SI(10] for calculating the updated salary. This SI[10] already has a copy of actual salary and now use it along with e[10] for finding the updated salaries of bonus months and store the update salary in SI[10] only. Next call to this same function must repeat the same operation to calculate Bonus salary of February of the desired employee. Calling this function 13th time will repeat the same operation for the month January of the desired employee. Maintain a sequence of function call for any desired employee. You may use static keyword where it is required but it is not compulsory. Call this function by passing both Employee e[10] and Employee *SI[10]. Remember, there is no getter() function to access the private data member salary, therefore a friend function is required. 5. Implement a function to print the salary of required employee for any month including bonus in the sequence of function call. This function can further call the friend function for calculations. 6. Assume two employees cannot have same salaries. 7. Use sorting instead of hard coding the below chart.
Below table provides an easy-to-understand example.
Employee Actual
Salary
Ranking Bonus
February Bonus
January
Salary+Bonus
Match
Employee
5000.2
3
5000.2 + 560.016
700.02
1
6000.2
4
6000.2 + 400.032
500.04
2
5000.4
4
5
5000.4 + 480.016
..
3
4000.4
1
8
4000.4 + 800
4
3000.4
3000.4 + 800.016
..
7000.2
3
7000.2 + 400.016
10000.0
8
1
10000.0 + 320.032
7
7500.6
7
2
7500.6 + 360.064
..
4500.8
7
4500.8 + 600.048
10000.2
9
10000.2 + 240.032
..
Provide the following functions:
Employee(Employee &);
• void setter(double);
Employee** Temporary(Employee []);
friend double Calculate(Employee **, Employee [], int);
double print(Employee **, Employee [], int);
Transcribed Image Text:Below table provides an easy-to-understand example. Employee Actual Salary Ranking Bonus February Bonus January Salary+Bonus Match Employee 5000.2 3 5000.2 + 560.016 700.02 1 6000.2 4 6000.2 + 400.032 500.04 2 5000.4 4 5 5000.4 + 480.016 .. 3 4000.4 1 8 4000.4 + 800 4 3000.4 3000.4 + 800.016 .. 7000.2 3 7000.2 + 400.016 10000.0 8 1 10000.0 + 320.032 7 7500.6 7 2 7500.6 + 360.064 .. 4500.8 7 4500.8 + 600.048 10000.2 9 10000.2 + 240.032 .. Provide the following functions: Employee(Employee &); • void setter(double); Employee** Temporary(Employee []); friend double Calculate(Employee **, Employee [], int); double print(Employee **, Employee [], int);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

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