Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ object oriented using visual studio Task (Static, Composition, inheritance, and Polymorphism) Part 1 In a university system, employees can be categorised into: academics and
C++ object oriented using visual studio
Task (Static, Composition, inheritance, and Polymorphism) Part 1 In a university system, employees can be categorised into: academics and administrators. However, all employees share common attributes: ID, Name, Hire Date, and salary. The Academics can have the additional attributes: Teaching load (hours), teaching allowance. The administrators have the additional attributes: job title, admin_allowance Note: name and job title are of type string, ID is const int, it is given a serial number starting from 200001, 200002, 200003, and so on. Salary, admin_allowance, Teaching load and teaching allowance of type double. Hire Date is of type Date (you have to write simple class Date) Declare all data attributes as private Given below the classes declarations Separate class interface and implementation 1) Create the base class Employee with the following functionalities: a) A constructor to initialize the data members and a virtual destructor b) A set function named set_values to change the Name, Hire_Date, and salary c) A function named print to display the details of Employee d) A virtual function named calaculate salary (this returns the salary) e) A pure virtual function void set _values( const string, double) to act as an interface to access set values in class Administrator, in case of Polymorphism Create derived class Administrator with the following functionalities: a) A constructor to initialize the data members and a destructor b) A set function to change the job_title and admin_allowance c) A function named print to display all details including the one from the base class d) A function named calaculate salary (this returns admin_allowance+salary). Hint: call calaculate salary0) 2) function in base class to get salary 3) Similarly create class Academic i nclude includecstring> using namespace std; class Datel private: int day,month, yeari public: Date (int-1,int-1,int-1935) -Date) void print ()const; Task (Static, Composition, inheritance, and Polymorphism) Part 1 In a university system, employees can be categorised into: academics and administrators. However, all employees share common attributes: ID, Name, Hire Date, and salary. The Academics can have the additional attributes: Teaching load (hours), teaching allowance. The administrators have the additional attributes: job title, admin_allowance Note: name and job title are of type string, ID is const int, it is given a serial number starting from 200001, 200002, 200003, and so on. Salary, admin_allowance, Teaching load and teaching allowance of type double. Hire Date is of type Date (you have to write simple class Date) Declare all data attributes as private Given below the classes declarations Separate class interface and implementation 1) Create the base class Employee with the following functionalities: a) A constructor to initialize the data members and a virtual destructor b) A set function named set_values to change the Name, Hire_Date, and salary c) A function named print to display the details of Employee d) A virtual function named calaculate salary (this returns the salary) e) A pure virtual function void set _values( const string, double) to act as an interface to access set values in class Administrator, in case of Polymorphism Create derived class Administrator with the following functionalities: a) A constructor to initialize the data members and a destructor b) A set function to change the job_title and admin_allowance c) A function named print to display all details including the one from the base class d) A function named calaculate salary (this returns admin_allowance+salary). Hint: call calaculate salary0) 2) function in base class to get salary 3) Similarly create class Academic i nclude includecstring> using namespace std; class Datel private: int day,month, yeari public: Date (int-1,int-1,int-1935) -Date) void print ()constStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started