Write a program having a base class Student with data member rollno and member functions getnum() to input rollno and putnum() to display rollno. A class Test is derived from class Student with data member marks and member functions getmarks() to input marks and putmarks() to display marks. Class Sports is also derived from class Student with data member score and member functions getscore() to input score and putscore() to display score. The class Result is inherited from two base classes, class Test and class Sports with data member total and a member function display() to display rollno, marks, score and the total(marks + score).
C++
Write a program having a base class Student with data member rollno and member functions getnum() to input rollno and putnum() to display rollno.
A class Test is derived from class Student with data member marks and member functions getmarks() to input marks and putmarks() to display marks. Class Sports is also derived from class Student with data member score and member functions getscore() to input score and putscore() to display score.
The class Result is inherited from two base classes, class Test and class Sports with data member total and a member function display() to display rollno, marks, score and the total(marks + score).
PLEASE GIVE CORRECT ANSWER IT WOULD HELP ME ALOT..
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images