State any four object oriented programming language.

1 Answer

Answer :

Object oriented programming language:

 C++

 Smalltalk

 Object pascal

 java

 Simula

 Ada

 Turbo pascal

 Eiffel

 C#

 Python

Related questions

Description : Give four differences between object oriented programming and procedure oriented programming.

Last Answer : Give four differences between object oriented programming and procedure oriented programming.

Description : State the concepts of object oriented programming.

Last Answer : Basic Concepts of Object Oriented Programming:  1. Objects  Objects are the basic run time entities in an object-oriented system. They may represent a person, a place, a ... objects that communicate with each other. Objects communicate with one another by sending and receiving information.

Description : Write down characteristics of object oriented programming.

Last Answer : Characteristics of object oriented programming are: Emphasis is on data rather than procedure. Programs are divided into objects. Data structures are designed such that they characterize the ... can be easily added whenever necessary. Follows bottom-up approach in program designing. 

Description : List features of procedure oriented programming.

Last Answer : Features of procedure oriented programming: 1. Emphasis is on doing things (algorithms). 2. Large program are divided into smaller programs known as functions. 3. Most of the functions share global ... transform data from one form to another. 6. Employs top -down approach in program design.

Description : Give advantages of object oriented approach over procedure oriented approach.

Last Answer : Advantages of object oriented approach over procedure oriented approach: 1. In object oriented approach, through inheritance we can eliminate redundant code and extend the use of existing classes. 2. ... with external systems much simpler. 10. In OOP software complexity can be easily managed.

Description : Implement a program to declare a class city with data members city name and state. Accept and display data for 1 object using pointer to object.

Last Answer : #include<iostream.h> #include<conio.h> class city { char city_name[20],state[20]; public: void accept() { cout<<"\nEnter city data:"; cout<<"\nName:"; ... ); ptr=&c; ptr->accept(); ptr->display(); getch(); }

Description : _________is popular object oriented programming language used for general purpose: a) C b) C++ c) FORTRAN d) None of These

Last Answer : b) C++

Description : Classic OOP - Object Oriented programming can be traced back to a language called Simula, and in particular Simula 67, which was popular during the _____: a) 1930s b) 1960s c) 1950s d) None of These

Last Answer : b) 1960s

Description : The pure object oriented programming language with extensive metadata available and modifiable at run time is (A) Small talk (B) C++ (C) Java (D) Eiffel

Last Answer : (A) Small talk

Description : Language model used in LISP is ................. (A) Functional programming (B) Logic programming (C) Object oriented programming (D) All of the above

Last Answer : (A) Functional programming

Description : Explain how to pass object as function argument.

Last Answer : An object may be used as function arguments in two methods:- i) A copy of the entire object is passed to the function. ii) Only the address of the object is transferred to the function. 1) Pass-by-value Since a copy ... (int h, int m) { hours = h; minutes = m; } void puttime(void)  { cout

Description : Write a program to show object as function argument. 

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class objarg  { char str[10]; public: void get() { cout<<"\n Enter a Message"; cin>>str; } void ... clrscr(); o1.get(); o2.copy(o1); o2.display(); getch();  }

Description : Explain the concept of memory allocation for object.

Last Answer : The memory space for object is allocated when it is declared & not when the class is specified. The member functions are created & placed in memory space only once when they are defined as a ... (object 1, object 2, object 3) has its own separate memory space for its member variables.

Description : Write a program to declare class student having data members name and percentage. Write constructor to initialize these data members. Accept and display this data for one object.

Last Answer : #include<iostream.h> #include<conio.h> #include<string.h> class student { char name[20]; float per; public: student(char n[],float p) { strcpy(name,n); per=p; } ... { student S("Sachin",78.00); clrscr(); S.putdata(); getch(); }

Description : Write a program to declare class having data member as hrs, mins, secs. Write constructor to assign values and destructor to destroy values. Accept & display data for one object.

Last Answer : #include<iostream.h> #include<conio.h> class time { private: int hrs, mins,sec; public: time(int h,int m,int s) { hrs=h; mins=m; sec=s; } ~time() { cout<< hours ... } }; void main() { time t(2,43,56); t.display(); getch(); }

Description : Write a program to implement the concept of virtual base class for following figure. Accept and display information of one employee with his name, code, basic pay, experience and gross salary with the object of employee class.

Last Answer : #include<iostream.h> #include<conio.h> class Master  {  char name[10],code[3];  public:  void acceptM() { cout<<"\nEnter name and code "; cin>>name>>code; ... .displayM(); e.displayA(); e.displayD(); e.displayE(); getch();  }

Description : Explain object as a function argument using following points with suitable example: (i) Pass by value (ii) Pass by reference

Last Answer : (i) Pass by Value: When an object is passed by value to a function, a copy of that object is created and changes are reflected on the copy object not on original object. Example: #include #include class Example { int x; public: Example(int a)  {  x=a;  }  void print()  { cout

Description : Describe pointer to object with an example. 

Last Answer : When address of an object of a class is stored into the pointer variable of the same class type then it is pointer to object. This pointer can be used to access the data member and member functions of same class. ... (); // Invoking getdata()using pointer to object p1. ptr->display(); }

Description : State any four rules for operator overloading.

Last Answer : Rules for operator overloading: 1. Only existing operators can be overloaded. New operators cannot be created. 2. The overloaded operator must have at least one operand that is of user defined type. 3. ... * and / must explicitly return a value. They must not attempt to change their own arguments. 

Description : State any four characteristics of friend function.

Last Answer : Characteristics of friend function: 1. It is not in the scope of the class to which it has been declared as friend. 2. As it is not in the scope of the class, it cannot be called using the ... public or the private part of a class without affecting its meaning. 6. It has the objects as arguments.

Description : State any four types of constructor.

Last Answer : Types of constructor: Default constructor Parameterized Constructor Constructor with Default Argument Copy Constructor Multiple/overloaded constructor

Description : State any four applications of OPP.

Last Answer : Applications of OOP: Real time systems Simulation and modeling Object-oriented databases Hypertext, hypermedia and expert Ext AI and expert systems Neural networks and parallel programming Decision support and office automation systems CIM/CAM/CAD systems

Description : Why friend function is required? Give four characteristics of friend function.

Last Answer : Friend function: Private members of a class cannot be accessed from outside the class. A non-member function cannot have an access to the private data of a class. Sometimes, two classes may need to ... part of a class without affecting its meaning. 6. Usually it has the objects as the arguments.

Description : Explain any four concept of OOP.

Last Answer : Basic Concepts of Object Oriented Programming:  1. Objects Objects are the basic run time entities in an object-oriented system. They may represent a person, a place, a bank ... objects that communicate with each other. Objects communicate with one another by sending and receiving information.

Description : Write any four differences between compile time and run time polymorphism.

Last Answer : Sr. No. Compile-time Polymorphism Run-time Polymorphism 1 Compile time polymorphism means that an object is bound to its function call at compile time. Run time polymorphism means that selection ... binding. 7 E.g. overloaded function call. E.g. virtual function.

Description : Write any four characteristics of constructor.

Last Answer : The constructor functions have some special characteristics. They should be declared in the public section. They are invoked automatically when the objects are created. They do not have return types ... They make 'implicit calls' to the operators new and delete when memory allocation is required.

Description : What is object oriented programming?

Last Answer : Object-oriented programming provides a higher level for programmers to envision and develop their applications. Without attempting to define the concept, we merely note that one deals with objects and ... problem is solved by interfacing the objects. It reduces the complexity of the program design.

Description : Briefly explain encapsulation and why it is important in object-oriented - programming.

Last Answer : Encapsulation is the principle that all of the data and functionality required by an object be contained by that object. This allows objects to exist as independent, interchangeable units of functionality without maintaining dependencies on other units of code.

Description : Which of the following are not programming paradigms types: a) Object Oriented Programming b) Aspect Oriented Programming c) Session Oriented Programming d) Structured Programming e) None of These

Last Answer : c) Session Oriented Programming

Description : One of the principal advantage of object oriented programming techniques over procedural programming techniques is that they enable programmers to create ______that do not need to be changed when a new type of object is added: a) Networks b) Modules c) Data Slates d) None of These

Last Answer : b) Modules

Description : Object Oriented Programming (OOP) is a _______philosophy: a) Network b) Design c) Data Type d) None of These

Last Answer : b) Design

Description : Name any two basics Principle of Object-Oriented Programming.

Last Answer : Ans. Encapsulation and Polymorphism

Description : Define class and object. (OBJECT-ORIENTED-PROGRAMMING-WITH-C++)

Last Answer : Class: Class is a user defined data type that combines data and functions together. It is a collection of objects of similar type.  Object: It is a basic run time entity that represents a person, place or any item that the program has to handle.

Description : Write the applications of object oriented programming.

Last Answer : Applications of object oriented programming are: 1) Real time systems 2) Simulation and modeling 3) Object-oriented databases 4) Hypertext, hypermedia and expertext 5) AI and expert systems ... and parallel programming 7) Decision support and office automation systems 8) CIM/CAM/CAD systems

Description : State characteristic of static data member. Explain why static data member must be defined outside the class. 

Last Answer : Characteristics of static data members: 1. It is initialized to zero when the first object of its class is created. No other initialization is permitted. 2. Only one copy of that member is created ... member(s) it is necessary to make static members global and re-declared outside of the class.

Description : Define constructor. State any two types of constructor.

Last Answer : Definition: A constructor is a special member function whose task is to initialize the objects of its class. Types of constructor: 1) Default constructor 2) Parameterized constructor 3) Copy Constructor 4) Constructor with default value 5) Multiple constructor/overloaded constructor

Description : State any two access specifier with example.

Last Answer : Access specifier: 1. private: 2. protected: 3. public Example: class sample { private: int a; protected: int b; public: void display() { cout

Description : State and describe use of pointer operator and address operator. Give one example of each. 

Last Answer : Pointer operator:- * It is used to declare a pointer variable. Also used as "value at" operator to read value stored inside the address pointed by pointer. Example: int *ptr; Address operator:-& ... address of a variable can be stored in pointer variable. Example: int a,*ptr; ptr=&a;

Description : State and describe visibility modes used in inheritance with their effects.

Last Answer : Visibility modes: private protected public Private: o When a base class is privately inherited by a derived class, public members and protected members of the base class become ... class Syntax: class derived: protected base { //Members of derived class; };

Description : State and describe access specifiers used inside class to declare members.

Last Answer : Access specifiers: 1. private 2. protected 3. public Private access specifier: Class members declared as private can be accessed only from within the class. Outside class access is not allowed for private members of ... { private: int a; protected: int b; public: void display() { cout

Description : State and describe types of inheritance.

Last Answer : Types of inheritance: o Single Inheritance o Multiple Inheritance o Multilevel Inheritance. o Hierarchical Inheritance o Hybrid Inheritance Single Inheritance o The mechanism of deriving a new class from existing single ... : public B, public C { // class D body; };

Description : State two advantages of pointer.

Last Answer : Advantages of pointer: Pointers save the memory. Pointers reduce the length and complexity of a program. Pointers allow passing of arrays and strings to functions more efficiently. Pointers make possible to return more than one value from the function. Pointers increase the processing speed.

Description : Write a program which concate and reverse string by using pointer to string.

Last Answer : #include #include void main()  { char str1[20], str2[20], rev[20],*p1,*p2; int cnt=0; clrscr(); coutstr2;  p1=&str1[0];  p2=&str2[0]; while(*p1!='\0')  { p1++;  } while(*p2!='\0')  { *p1=*p2; p1++; p2++;  }  *p1='\0'; cout

Description : What is constructor? How user can declared constructor in derived class? Explain with example.

Last Answer : Constructor:- Constructor is a special member function which has same name as a class name and is used to initialize object during compile time of program. Declaring constructor in derived class If a base class contains a ... derived d(2,5); d.displaybase(); d.display(); getch(); }

Description : What is function? What is call by value? What is call by reference? What is the difference between them?

Last Answer : Function: A function is a group/set of statements/instruction that performs a specific task. It can be system defined i.e. clrscr(), getch(), or user defined i.e. add(), sub(). ... reflected inside as well as outside the function. Difference between Call by Value and Call by Reference:

Description : What is polymorphism? Enlist different types of polymorphism. What are the differences between them?

Last Answer : Polymorphism: It is a feature of object oriented programming which allows a programmer to have a more than one function having same name but different /same parameters but performs different/ ... Compile Time polymorphism o Virtual Function Difference between Types of Polymorphism:

Description : Write a program which perform arithmetic operation using pointer.

Last Answer : #include<iostream.h> #include<conio.h> void main() { int num[5]={56,75,22,18,90}; int ptr; int i; cout<< array elements are:: ; for(i=0;i<5;i++) ptr=num; cout<< ... 3; cout<< value of ptr+=3:: <<*ptr; cout<< \n ; getch(); }

Description : How to define virtual function? Give example.

Last Answer : A virtual function is a member function that is declared within a base class and redefined by a derived class. To define virtual function following syntax is used: Class baseclass { virtual function_name() { } ... } }; Example: #include class Base { public: virtual void show( ) { cout

Description : What is structure? How user declare structure? Give example.

Last Answer : Structure is a collection of different data types written under a common name. It is a user defined data type. To Define a structure following Syntax is use:- struct structure_name { data_type variable 1; data_type ... () {  Person p1; cout>p1.name; cout> p1.age; cout> p1.salary; cout

Description : What is copy constructor? Explain with example.

Last Answer : Copy constructor: The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. The copy constructor is used to: ... ; // Copy constructor is called here // Let us access values assigned by constructors cout