Computer Science, asked by basilwanjohi, 4 months ago

a) 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 registration 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 in C++ to model this relationship.

Answers

Answered by kattanagamani856
8

Explanation:

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 the roll number, name etc.Create the class Exam by inheriting the student class. The Exam class adds data members representing the marks scored in six subjects. Derive the Result from Exam class and its own data members such as total marks. Write an interactive program to model this relationship.INHERITING CLASS STUDENT AND MAKING RESULT include using namespace std; class student{//base class student protected: char name[20]; int roll_no; public: void getdata(){ cout...

Similar questions