Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.



Share on Google+Share on Google+

Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.
1 Answer(s)      4 years and 11 months ago
Posted in : Java Beginners

(Aim:- The main aim of this experiment is reusability of code and getting idea about classifying objects , identifying specific and generic objects and creating hierarchy between objects ). Objective: Student will get awareness to create relationship between objects.

View Answers

October 31, 2012 at 10:12 AM

Here is a code that demonstrates you the concept of multiple inheritance.


class student
       int rno,m1,m2;
                void get()
                            cout<<"Enter the Roll no :";
                            cout<<"Enter the two marks   :";
class sports
       int sm;                   
                void getsm()
                 cout<<"\nEnter the sports mark :";

class statement:public student,public sports
    int tot,avg;
    void display()
                 cout<<"\n\n\tRoll No    : "<<rno<<"\n\tTotal      : "<<tot;
               cout<<"\n\tAverage    : "<<avg;
void main()
   statement obj;


Related Tutorials/Questions & Answers:
Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.
Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.  (Aim:- The main aim of this experiment...; Here is a code that demonstrates you the concept of multiple inheritance
Object Oriented Programming in Java
OOPS acronym for Object Oriented Programming is a model or concept that works... of a class. For a language to be an Object Oriented Programming Language, it must... concept are used to create programs based on the real world. By the name OOPS
Inheritance in java with example
Inheritance in java with example          Inheritance is one of the concept of the Object- Oriented programming. The advantage of using the inheritance
object oriented programming protocol
object oriented programming protocol  What is object oriented programming protocol? Is it different from objective c protocol programming?? Thanks
Object Oriented Programming in PHP
Object Oriented Programming in PHP  Hi, Which version of PHP supports OOPS. How can I learn Object Oriented Programming in PHP? Thanks
Object Oriented Programming II
Object Oriented Programming II  Instructions: ->each class to be created must have encapsulated fields, setters and getters methods, and constructors Create a class named "Paper" with the following attributes
An Overview of Java      Java is a programming language      Java is Object Oriented Programming
; Java as a programming language Java is an Object oriented... are in pure C code, not C++. The function prototypes are in an object-oriented form...; Java as an Object Oriented Language In this section, we will discuss the OOPs
object oriented programming - Java Beginners
object oriented programming  sir, i read in the book tat object oriented program exhibits recurring structures. i want to know "what is meant by recurring structures?"  Hi Friend, Any structure to be occurred over
What are the features and advantages of OBJECT ORIENTED PROGRAMMING?
What are the features and advantages of OBJECT ORIENTED PROGRAMMING?  What are the features and advantages of OBJECT ORIENTED PROGRAMMING
Difference between Java and C++
that supports procedural programming and object oriented programming. C++ fully... and application programming. C++ has added support for object-oriented programming...++. C++ supports procedural, functional and object oriented programming
Object-Oriented programming - Java Beginners
Object-Oriented programming  Write a program to display the names and salaries of 5 employees.Make use of a class and an array.The salary of each employee should increase by 5% and displayed back.  Hi friend, Code
Concept of Inheritance in Java
Concept of Inheritance in Java Concept of Inheritance in Java is considered one of the important features of Object Oriented Programming. Inheritance... class from parent class. Let's understand the concept of inheritance in Java
Is Java object oriented?
Is Java object oriented?  Hi, Is Java object oriented? Thanks   Hi, Java is object oriented programming language. It is supports OPPS concepts: Object Class Inheritance Polymorphism Abstraction Encapsulation All
Object Oriented
Object Oriented  C++ is Purely object oriented or not .Then why java called purely object oriented
Java using Netbeans Object Oriented Programming
Java using Netbeans Object Oriented Programming   I am trying to make a program that uses a main class and a separate class with one public method and one private method. The main method in the main class asks the user for 2
Multiple Inheritance
class so java any how do multiple inheritance? Can you please explain...Multiple Inheritance  All are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined
multiple inheritance.
multiple inheritance.  hello, can java support multiple inheritance???   hi, java does not support multiple inheritance
Inheritance in Java
Inheritance, one of the important concepts of Object Oriented Programming... class. Multilevel Inheritance: Multiple Inheritance is when a subclass is derived... for it's just above (parent) class. Multilevel inheritance can go up to any number
Learning Java Programming for Beginners
Java is an Object Oriented Programming Language that was developed by Sun Microsystems. It is based on C, C++ programming language but a tad better.... Programmer can post any problem and ask any doubt. What is Programming
multiple inheritance
multiple inheritance  why java doesn't support multiple inheritance? we can achieve this by using interface but not with classes? what is the main reason that java community implemented like
java is pure object oriented
are not object 2)It does not support operator overloading multiple inheritance. 3...java is pure object oriented  java is pure object oriented or not.? reason.?   Java is not pure object oriented language because
Multiple Inheritance
Multiple Inheritance  Why Java Doesn't have Multiple Inheritance It is Advantage or Disadvantage.........   Hi Friend, When we extends... and inconsistencies Java does not support Multiple Inheritance. Thanks
Is Java a pure object oriented language?
programming language but not purely a object oriented language. In OOPs programming... through the class and object creation. For more object oriented programming language...Is Java a pure object oriented language?   Hi, Is Java a pure
Inheritance in Java with example
Here we are going to discuss Inheritance in Java with a simple example. Inheritance is a Object Oriented Programming concepts, which allows to extend... of more than one class into a single class. Multiple inheritance in Java can
multiple inheritance
multiple inheritance  Class A extends Class B but Class A also inherit Super Class Object so it is multiple inheritence give reason in support of your answer
Java Inheritance Concept.
Java Inheritance Concept.  Yesterday i got confused with following question in an aptitude exam. Question:Class A,B,C have method named doit(). Class B extends Class A,Class C extends Class B.How will you call method doit
Java as an Object Oriented Language
applications and programs. OOP stands for Object Oriented Programming.... There are four main pillars of an Object Oriented Programming Language... of object oriented programming language. Class itself does nothing but the real
PHP Inheritance Class
Inheritance in PHP: Inheritance is a property of Object Oriented Programming, PHP also supports this principle in its programming as object model... in programming At the same time we must keep in our mind that when we should
OOPs and Its Concepts in Java
common. In object oriented programming classes can inherit some common behavior...;    Brief Introduction to OOP Object Oriented Programming or OOP is the technique to create programs based on the real world
Difference between C++ and Java
Java and C++ are Object Oriented Programming (OOPs) language. Java... programming and extends the C programming language. Java supports network computing... the class In C++ programming can be done without making objects
Object Oriented concepts
OOP stands for Object Oriented Programming. This is a technique used to develop programs revolving around the real world entities. In OOPs programming... on the following links Object Oriented concepts