Design a class named Record that includes
· A data member named rollNo for student roll number
· Two data fields i.e. course1Name and course2Name of type string
· A parameterized constructor to initialize rollNo, course1Name, and course2Name data fields
· Three getter functions to get the value of rollNo, course1Name, and course2Name, respectively
Derive a class named CourseRecord inherited from Record class and contains
· Two additional data members i.e. marksCourse1 and marksCourse2
· A parameterized constructor to initialize its own data fields along with the inherited data fields
· Two getter functions that return the value of marksCourse1 and marksCourse2, respectively
Derive a class named CourseResult inherited from class CourseRecord and has
· A data field named totalMarks
· A function named marksObtained that returns totalMarks (i.e. marksCourse1 + marksCourse2) of a student.
Comments
Leave a comment