Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.

Have Programming Question? Ask it here!
 
 
 


mounika
Exp.4 Write any C++ programs to demonstrate multiple inheritance concept of an object oriented programming.
1 Answer(s)      a year and 5 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.


Advertisement
View Answers

October 31, 2012 at 10:12 AM


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

#include<iostream.h>
#include<conio.h>

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

              }
};
class statement:public student,public sports
{
    int tot,avg;
    public:
    void display()
              {
                 tot=(m1+m2+sm);
                 avg=tot/3;
                 cout<<"\n\n\tRoll No    : "<<rno<<"\n\tTotal      : "<<tot;
               cout<<"\n\tAverage    : "<<avg;
              }
};
void main()
{
   clrscr();
   statement obj;
   obj.get();
   obj.getsm();
   obj.display();
   getch();
}


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
Advertisements
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
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
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  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
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
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
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
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
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
Object Oriented
Object Oriented  C++ is Purely object oriented or not .Then why java called purely object oriented
multiple inheritance.
multiple inheritance.  hello, can java support multiple inheritance???   hi, java does not support multiple inheritance
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
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
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
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
Object-Oriented Design - Overview
best practice is use of object-oriented approaches, using Object-Oriented Design (OOD) and implementing the design with Object-Oriented Programming (OOP... Java: Object-Oriented Design - Overview Background. Software development
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
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
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
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
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
c++ programs
c++ programs  i want the syntax for the following programs according to c++ pattern. 1.sum of multiples of an integer upto 10 2.2/4+4/6+6/8+8/10+.....n/n+2 3.1!/1+2!/2+3!/3+4!/4+...n!/n i just want the main logic as i m nt
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
c++ programs
c++ programs  Write a program with the following (a) A function to read two double type numbers from keyboard (b) A function to calculate the division of these two numbers (c) A try block to throw an exception when a wrong type
c++ programs
c++ programs  Write a program with the following (a) A function to read two double type numbers from keyboard (b) A function to calculate the division of these two numbers (c) A try block to throw an exception when a wrong type
programming concept
programming concept  Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the shipping cost based on the following schedule
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
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
multiple inheritance - Java Beginners
multiple inheritance  Why java does not support Multiple Inheritance...)why java classes does not support Multiple Inheritance? JAVA CLASSES ONLY... Inheritance. Ans...>java classes doesn't support multiple inheritance,the practical
write a program to demonstrate wrapper class and its methods......
write a program to demonstrate wrapper class and its methods......  write a program to demonstrate wrapper class and its methods
java : object oriented
java : object oriented   (a) Write a class named CarRental... and their relationship. (c) Write an application named UseCarRental that prompts... for above two classes and their relationship. (c) Write an application named
What is attribute oriented programming?
What is attribute oriented programming?  Hi, What is attribute oriented programming? Thanks
fully object oriented language - Java Beginners
fully object oriented language  Is java is a fully object oriented language?if no,why?  Hi Friend, Java is not a fully object oriented... multiple inheritance. 3)It allows static methods to call without creating
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
multiple inheritance - Java Beginners
multiple inheritance  can u implement one class to more than one interface
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
Multiple Inheritance Problem - Java Beginners
Multiple Inheritance Problem  Hello Friend why Multiple Inheritance... methods i. void show() in 3 super-classes named as A,B,C and if i extends A,B,C... i.e void show(int a),void show(int b,int c) and void show(int d,int e,int f
C and C++ books-page2
++ are widely promoted as ideal portable, fast, and - in the case of C++ - "object-oriented" languages. This characterization is deserved when C is considered... processing or spreadsheet programs. C was designed as a reasonably transportable
Does Java support multiple inheritance?
Does Java support multiple inheritance?  Hi, Does Java support multiple inheritance? thanks   hi, Please visit the following link: http://www.roseindia.net/java/language/inheritance.shtml Hope
Inheritance
that is already made. It is one of the most important feature of Object Oriented Programming. It is the concept that is used for reusability purpose. Inheritance...; To know the concept of inheritance clearly you must have the idea of class and its
Java Object
Java Object         Object is the basic entity of object oriented programming language. Object.../java-object-oriented-language.shtml  
how can i achieve multiple inheritance in java without using inheritance ?
how can i achieve multiple inheritance in java without using inheritance ?  how can i achieve multiple inheritance in java without using inheritance
Write Full concept of abstract class
Write Full concept of abstract class  Abstract class
Java7 : OOPs Concepts
JAVA7 : OOPs Concept In this section we will discuss concept of Object oriented programming. Object Oriented Programming : Object Oriented Programming, better termed as OOPs is a paradigm where everything is represented as an object
Multiple inheritance using interface - Java Beginners
Multiple inheritance using interface  Hi, I understand.... But the use of the interface is when we use multiple inheritance with more than one... in multiple inheritance Thank you, Rajkanth  Hi Friend, Please
 

 

 

DMCA.com