Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

c++ solve the following using association
do write comments for better understanding
inheritance
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

Explain how autism spectrum disorder affects development.

Answered: 1 week ago