Question: 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
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
A member function named display to show rollNo, course1Name, course2Name, marksCourse1,
marksCourse2, and totalMarks
Create main() to check the operability of the code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
