Search for question
Question

B) Create two derived class called Student and Staff that has the following class members:

Staff [staff.cpp]

double salary;

int numYears;

•double compute Bonus(); // each year of employment accrues an additional 5% bonus (compounded annually)

• void print()

- Student [student.cpp]

• double tuition;

int numYears;

double compute Discount(); // each year of being a student discounts an additional 5%(compounded annually)

void print() C) Create a main function that adequately tests both your derived class and prints thebonus/discount [main.cpp].

Fig: 1

Fig: 2