Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

n 10. Using the concept of hybrid Inheritance write a C++ program with following specification a) Create three classes student, test and sports b) Class

n

10. Using the concept of hybrid Inheritance write a C++ program with following specification a) Create three classes student, test and sports b) Class test inherits student c) Class student contains protected access modifier which has variable roll number d) Class student contains public access modifier which contains function get_number which accepts students IDnumber and put_number display students IDnumber e) Class test contains protected members mrk1 and mrk2 f) Public access modifier in class test contains function get_marks which accepts marks 1 and 2 and also function put_marks which displays marks obtained in subject 1 and subject 2 e) Class sports contains protected members score B. Public access modifier in class test contains function get_score which accepts score and also function put_score which displays marks obtained in sports h. Finally calculate total marks which in sum of sports marks + subject 1 marks+ subject 2 marks Description: Hybrid Inheritance is combination of Hierarchical and Multilevel Inheritance. B A D C

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

a C program that demonstrates hybrid inheritance based on the given specifications include using namespace std class Student protected int rollNumber ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Cambridge International AS & A Level Mathematics Probability & Statistics 1 Coursebook

Authors: Dean Chalmers, Julian Gilbey

1st Edition

1108407307, 978-1108407304

More Books

Students also viewed these Programming questions