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
Comments
Leave a comment