SSN College of Engineering Department of Information Technology Cs2203 - Object Oriented Programming Iii Sem - B Question Bank
SSN College of Engineering Department of Information Technology Cs2203 - Object Oriented Programming Iii Sem - B Question Bank
SSN College of Engineering Department of Information Technology Cs2203 - Object Oriented Programming Iii Sem - B Question Bank
UNIT I
1. State the characteristics of procedure oriented programming.
• Emphasis is on algorithm.
• Large programs are divided into smaller programs called functions.
• Functions share global data.
• Data move openly around the system from function to function.
• Functions transform data from one form to another.
• Employs top-down approach in program design.
6. Define Objects.
Objects are the basic run time entities in an object oriented system. They are instance of a class. They
may represent a person, a place etc that a program has to handle. They may also represent user-defined
data. They contain both data and code.
7. Define Class.
Class is a collection of objects of similar data types. Class is a user-defined data type. The entire set of
data and code of an object can be made a user defined type through a class.
20. What are the input and output operators used in C++?
The identifier cin is used for input operation. The input operator used is >>, which is known as the
extraction or get from operator. The syntax is, cin >> n1; The identifier cout is used for output operation.
The input operator used is <<, which is known as the insertion or put to operator. The syntax is, cout <<
“C++ is better than C”;
22. List out the four basic sections in a typical C++ program.
• Include files
• Class declaration
• Member functions definition
• Main function program
24. Define identifier. What are the rules to be followed for identifiers?
Identifiers refer to the names of variables, functions, arrays, classes etc created by the programmer. The
rules are as follows:
34. List out the advantages of new operator over malloc ().
• It automatically computes the size of the data object.
• It automatically returns the correct pointer type.
• It is possible to initialize the objects while creating the memory space.
• It can be overloaded.
43. List out the conditions where inline expansion doesn’t work.
• For functions returning values, if a loop, a switch, or a goto exists
• For functions not returning values, if a return statement exists
• If functions contain static variables
• If inline functions are recursive
UNIT II
1. State the difference between structures and class.
By default the members of a structure are public whereas the members of a class are private.
2. Define a class.
A class is a way to bind the data and its function together. It allows the data to be hidden from external
use. The general form of a class is,
class class_name
{
private:
variable declarations;
function declaration;
public:
variable declarations;
function declaration;
};
Here, class B is derived from class A and class C is further derived from
the derived class B.
5. Define multiple inheritance.
In multiple inheritance, a single class is derived from more than one base
class.
A
B
A
B
C15
Here class C is derived from two base classes A and B.
6. Define Hierarchical inheritance.
In hierarchical inheritance, more than one class is derived from a single
base class.
Here class B and C are derived from class A.
7. Define Hybrid inheritance.
Hybrid inheritance is defined as a combination of more than one
inheritance.
Here, Classes A, B and C represent hierarchical inheritance. Classes A, B &
D and classes A, C and D represent multilevel inheritance. Classes B, C and D
represent multiple inheritance.