Consider an example of declaring the examination result. Design three classes: Student, Exam and Result. The Student class has data members such as those representing roll number, name etc. create a class Exam by inheriting the student class. The exam class adds data members representing the marks scored in six subjects. Derive class Result from the exam class and it has own data members such as total_marks. Write an interactive program to model this relationship. What type of inheritancethis model belongs to? C++
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Consider an example of declaring the examination result. Design three classes:
Student, Exam and Result. The Student class has data members such as those
representing roll number, name etc. create a class Exam by inheriting the student class.
The exam class adds data members representing the marks scored in six subjects.
Derive class Result from the exam class and it has own data members such as total_marks. Write an interactive program to model this relationship. What type of inheritancethis model belongs to? C++
Step by step
Solved in 3 steps with 3 images