Question
using namespace std; class Student //Base class - Grand Parent { protected: int: rollNumber; static int count; public: void SetNumber() { cout > rollNumber; count++;
using namespace std;
class Student //Base class - Grand Parent { protected: int: rollNumber; static int count; public: void SetNumber() { cout > rollNumber;
count++; } void GetNumber() // Accessor { cout
};
int Student :: count;
class Test : public Student //Derived class(child) from Student class, and Parent of Result class { protected: float marks1, marks2; public: void SetMarks() { cout > marks1;
cout > marks2; } void GetMarks() { cout
class Result : public Test //Derived class from Test class- grand child { float total; public: void display() { total = marks1 + marks2; GetNumber(); GetMarks(); cout
}; const int Size = 4; //Main Program int main() { Result student[SIZE];
}
This is what I have so far. I need to be able to output the marks of the first course and second course for 4 students.
*** Multilevel Inheritance In this example program, did the following: - Multilevel Inheritance EXAMPLE Submit the project as ICE9_firstname. Author: @Author2: Bavethran Vijeyan @date 2020-02 * Description : Assume that the test results of a batch of students (array of objects) are stored in * three different classes. * Class Student stores the roll-number(protected-int data type), Mutator to input the value of roll number, * Accessor to retrieve the roll number of the student * Class Test is subclass of Student Class. It has marks of two courses (protected - int data type) for the student. * Have the Mutator and Accessor for getting the marks(input) and retrieving them. * Class Result is a subclass of Test class. It contains a display method which calculates the total marks * and displays the total. * The main program should display the rollnumber, marks of two courses and their total for all the student. * The skelton code is provided to you. Follow the instructions in the class. ****Student Information Enter the details of Student : Enter the Roll Number of student: 11 Enter the marks of First course: 23.45 Enter the marks of second course: 34.56 Enter the details of Student 2 Enter the Roll Number of student: 12 Enter the marks of first course: 78.45 Enter the marks of second course 23.56 Enter the details of student 3 Enter the Roll Number of student! 13 Enter the marks of first course: 78.45 Enter the marks of second course 45.56 Enter the details of Student 4 Enter the Roll Number of student 14 Enter the marks of first course! 23.4 Enter the marks of second course: 67.34 the details of student is as follows: Detail of student 1 2011 Aber: 11 Marties in course 1: 23.45 Parks in Course 2: 34.56 Fotal marks of the students 8.1 Detail of student 21 Foll Number: 12 farla in Course 1: 73.45 Maria in course 2: 23.56 Total marks of the student 102.01 Detail of student 3: Roll Number: 13 sarta in Course 1: 78.45 Marius in course 2: 45.56 Total marks of the student 124.63Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started