Hello All ..
I have homework and I don't know how can I solve it can you help me :(
this is the homework :
1- Creat class called Employee that has two data member :
Name,PayRate .
Creat constructor that initialize the data members . Also , function to calculate the salary getSalary() .
creat another class called HourlyEmp they publicy inherit from class Employee . It inherits all tha data members plus its own (hour)
getSalary() in the HourlyEmp class will calculate the salary depending on the hours .
2- Add print() function to be able to print the name of an employee and the salary .
3- after declaring the classes , perform polymorphism concept on . Hint, you will need to make one of the functions in the base class to be virtual .
Add destructors to the classes that mentioned above .
You will need to create a pointer to a class , creat it by using dynamic allocation .
thanx
Last edited on
What do you have already?
What parts of it do you have problems with?
Let's see what you have so far.
Since you've made no actual attempt to try this yourself, I'm sure you'll understand everybody's reluctance to help.