An industry is maintaining two independent set of employees details (Technical and Non-technical). It has decided to giv
Posted: Fri May 20, 2022 1:02 pm
An industry is maintaining two independent set of
employees details (Technical and Non-technical). It has decided to
give a New Year bonus for all employees based on the criteria as
follows. For technical employees, if the basic pay is greater than
or equal to Rs.15000 then the bonus will be 10% of his/her basic
pay, and bonus will be 12% of basic pay otherwise. For non –
technical group of employees, bonus of 15% of basic pay will be
given when basic pay is greater than or equal to 7000 and a bonus
of 20% of basic pay is given otherwise. Create a Base class
Employee and a member function as calculateBonus(). Inherit two
classes Technical and NonTechnical from Employee. Develop a C++
program to using the concept of inheritance to determine the bonus
for each employee and print them in the descending
order of the bonus amount. Round off bonus amount to two decimal
places.
Input
Read the number employees, 'n'
ID number of employee1
Type of employee1 (0 for technical and 1 for
non-technical)
Basic pay of employee1
ID number of employee2
Type of employee2 (0 for technical and 1 for
non-technical)
Basic pay of employee2
….
ID number of employee-n
Type of employee-n (0 for technical and 1 for
non-technical)
Basic pay of employee-n
Output
Print details sorted by Bonus amount
ID, Type and Bonus for employee1
ID, Type and Bonus for employee2
…
ID, Type and Bonus for employee-n
(Please don't post Screenshot)
employees details (Technical and Non-technical). It has decided to
give a New Year bonus for all employees based on the criteria as
follows. For technical employees, if the basic pay is greater than
or equal to Rs.15000 then the bonus will be 10% of his/her basic
pay, and bonus will be 12% of basic pay otherwise. For non –
technical group of employees, bonus of 15% of basic pay will be
given when basic pay is greater than or equal to 7000 and a bonus
of 20% of basic pay is given otherwise. Create a Base class
Employee and a member function as calculateBonus(). Inherit two
classes Technical and NonTechnical from Employee. Develop a C++
program to using the concept of inheritance to determine the bonus
for each employee and print them in the descending
order of the bonus amount. Round off bonus amount to two decimal
places.
Input
Read the number employees, 'n'
ID number of employee1
Type of employee1 (0 for technical and 1 for
non-technical)
Basic pay of employee1
ID number of employee2
Type of employee2 (0 for technical and 1 for
non-technical)
Basic pay of employee2
….
ID number of employee-n
Type of employee-n (0 for technical and 1 for
non-technical)
Basic pay of employee-n
Output
Print details sorted by Bonus amount
ID, Type and Bonus for employee1
ID, Type and Bonus for employee2
…
ID, Type and Bonus for employee-n
(Please don't post Screenshot)