Write a Program to declare examination results. Design three classes: Student, Exam, Result. The Student class has the data members such as Rollno and name. Create the class Exam by inheriting the Student class. The Exam class includes the data members representing the marks scored in six subjects. Derive the Result from Exam class and it has its own data members such as Total marks as well as calculate the grade based on total marks. Display the result with all the student information in descending order of their grade.
class Student {
private:
string rollno;
string name;
};
class Exam: public Student {
private:
int *marks_scored;
string subjects[6];
};
class Result: public Exam {
private:
int total_marks;
};
Comments
Leave a comment