Write a C++ program for student’s evaluation concept using inheritance. Algorithm Step1: create a class studentpersonal declare rollno, age, name, sex in protected mode. Step2: Using a parameterized constructor initialize the values for all the data members. Step3: Create another class studentmark that is inherited from the baseclass and having the data members mark1 ,mark2 ,mark3,mark4 Using a parameterized constructor initialize the value for mark1,mark2,mark3,mark4. Step4: Create another class called studentsports and declare score as protected mode. Step5: Create a class studentresult and public inherited form studentmarks and studentsports having the data members total, avg, and grade.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a C++ program for student’s evaluation concept using inheritance.
Step1: create a class studentpersonal declare rollno, age, name, sex in protected mode.
Step2: Using a parameterized constructor initialize the values for all the data members.
Step3: Create another class studentmark that is inherited from the baseclass and having the data members mark1 ,mark2 ,mark3,mark4 Using a parameterized constructor initialize the value for mark1,mark2,mark3,mark4.
Step4: Create another class called studentsports and declare score as protected mode.
Step5: Create a class studentresult and public inherited form studentmarks and studentsports having the data members total, avg, and grade.
Step6: Calculate the total and avg and display the result.
Step by step
Solved in 3 steps with 1 images