Question: c++ solve the following using association do write comments for better understanding inheritance Implement a base class and derived classes in C++ Understand the working





Implement a base class and derived classes in C++ Understand the working of base class and derived class constructors/destructors. Understand the working and purpose of private and protected attributes of a base class. Use base class member functions in a derived class. Exercise 1 Consider the following hierarchy as it exists in a university: There are two types of persons in the university i.e. Student and Faculty Every person has some basic information that is common to all persons i.e. the first_name and last_name stored as private attributes and age which is a protected attribute. A student can in turn be either an Undergraduate or a Graduate student, every student has a cgpa. An undergraduate student has a fyp_name as his private attribute. A graduate student has a thesis topic as his private attribute. A faculty member has private attributes about the number of courses he is currently teaching, i.e. his course_count and a three digit telephone extension number. Implement these classes i.e. define all the classes along with their attributes and their inheritance. Every class should be defined in a separate header file named according to the class name. Exercise 2 Add appropriate constructors and destructors to all the classes created in Exercise 1. For example the constructor for the Person class should take three inputs (for first_name, last_name and age). The student constructor should take four inputs, three for its parent class (i.e. Person) and one float value to be assigned to the cgpa attribute. This is accomplished in the following manner: Person (char* Ename, char. Iname, int age) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
