Question: Finish the tasks based on the given skeleton codes. (C++) Task1: employee.cpp is given and employee.h is partially completed. Read main.cpp to see how dynamic
Finish the tasks based on the given skeleton codes. (C++)
Task1:
employee.cpp is given and employee.h is partially completed. Read main.cpp to see how dynamic binding is used and declare some of the functions of Employee class as virtual. Since employee is an abstract base class, there is one pure virtual function. Which function should you declare as pure virtual?
Task2:
Complete the rest of constructor and destructor of Employee, and the implementation of classes Cook, DeliveryMen and Manager.(For other headers, need to make your own just as employee.h) When implementing the print_description() method of the subclasses, you may need to call the method of Employee class. You have to allocate dynamic memory for the name of Employee. strlen() and strcpy() functions are useful here.
>employee.h

>employee.cpp

>main.cpp

>sample output:

#ifndef EMPLOYEE_H #define EMPLOYEE_H class Employee public: // Modify the function declarations below Employee(const char* name); Employee(); void print_description() const; void print_salary() const; private: char* name; #endif #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
