100% found this document useful (1 vote)
467 views

Object Oriented Programming Using C++ Second Year Sem II: Two Marks Questions

This document contains two mark questions and long answer questions related to object oriented programming concepts in C++. It covers topics like scope resolution operator, operators that cannot be overloaded, differences between constructors and normal functions, default access mode for class members, cascading I/O operators, structure of a C++ program, I/O streams, abstract classes, templates, this pointer, containers, functions, inheritance, polymorphism, exception handling, file handling functions and more. Students are expected to write programs and provide explanations for the concepts covered in the questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
467 views

Object Oriented Programming Using C++ Second Year Sem II: Two Marks Questions

This document contains two mark questions and long answer questions related to object oriented programming concepts in C++. It covers topics like scope resolution operator, operators that cannot be overloaded, differences between constructors and normal functions, default access mode for class members, cascading I/O operators, structure of a C++ program, I/O streams, abstract classes, templates, this pointer, containers, functions, inheritance, polymorphism, exception handling, file handling functions and more. Students are expected to write programs and provide explanations for the concepts covered in the questions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Object Oriented Programming Using C++

Second Year Sem II


Two Marks Questions
1 What is the use of scope resolution operator (::)in C++.

2 What are the operators of C ++ that cannot be overloaded?

3 How does constructor differ from normal functions?

4 What is the default access mode for class members?

5 What do you mean by cascading of I/O operators?

6 What is the structure of C++ program?

7 What will be the output of the following code?


For (int m=0;m 5;m++)
Cout m;

8 What does the following poop prints


out?
int m=1;
while(m 11)
{
m++;
cout<<m++;
}

9 What is I /O stream ?

10 What is the type of class for which objects cannot be created?

11 How to open and close file ?

12 What is generic in templates ?

13 What is “this” ?

14 What is container?

15 What is the difference between private and protected class members .

16 What do you mean by function ?What is the prototype of function?

17 What is the use of scope resolution operator (::) in C++?

18 What are the operators of C++ that cannot be overloaded?

19 How does constructor differ from normal functions?


20 What is the default access mode for class members?

21 What do you mean by cascading of I/ O operators?

22 What is the structure of C++ program?

23 What will be the output of the following code ?

For (int m=0 ;m<5;m++)


Cout <<m;
h) What does the following poop prints out?
Int m=1 ;
While (m<11)
{
m++;
cout<< m++;
}

24 What is an I/O stream ?


25 What is the type of class for which objects cannot be created?
26 How to open and close file?
27 What is generic classes in templates ?
28 What is “this”?
29 What is container?
30 What is the difference between private and protected class members?
31 What do you mean by function? What is prototype of function?

32 What are the different types of constructor?


33 What is the importance of Destructor?
34 Define reference variable.
35 What is data hiding?
36 Why cout and Cin are not considered as keyword?
37 When the memory is allocated to an object? How ?
38 Write any four characteristics of friend function.
39 Identify the error in following
#include<Iostream.h>
int fun ()
{
return 1;
}
float fun().
{ return 10.23;
void main()
{
cout <<(int) fun ()<< ‘
cout <<(float) fun ()<< ‘

40 State characteristic of static data member.


41 Give structure of C++ program.
42 Describe new and delete operator.
43 Write any four rule of operator overloading.
44 Explain syntax of class?
45 When do we use protected visibility specifier to a class member?
46 How do we invoke c onstructor function?
47 Identify the error in following program
# include <iostream .h>
struct Room
{ int width;
int length;
void set value (int w, int l)
{ width =w; length=l;}
};
Void main ()
{ Room ObjRoom;
ObjRoom.setValue (12, 1.4);
}

48 When do you make a class virtual?


49 Can a member function in derived class have same name as that of one in base
class?
50 What do you mean by exception?
51What does “this” Pointer point to?
52 Define template.
53What is abstract class.
54 Discuss role of file ( ) function
55 State the errors of any in the following statement
i. cout <<(void*) amount;
ii. cout << width();

Long Answer Questions

Explain the following concepts of OOP in detail with an example.


a) Data abstraction b) Inheritance c) Polymorphism d) Objects

Write a C++ program to overload + & operator which perform the addition & subtraction of two
matrix of 3by3 respectively.

What do you mean by inline function? Explain with example.

Describe the concept of call by value & call by reference with an programming example.

What is the significance of static members in C++? Explain with example.

Explain the various types of constructor with an programming example.

Describe the concept of destructor with an programming example.

Define Inheritance .Explain multilevel inheritance with programming example?

Write short note on new and delete operators.


Explain the concept of pure virtual function with example.

Explain with example how can a class template be created.

Write a C++ program to read a file name and display the content of file on screen.

Explain I/O manipulators.

Differentiate between static & dynamic binding with example.

Write a program which explains the concept of single level inheritance.

Explain in detail
i.Data Abstraction & Encapsulation
ii.polymorphism

Discuss advantages , disadvantages & limitations of inline function.

Write a program for addition of two complex numbers overload ‘+’ binary operator using friend
function

WAP for function over loading in c++

WAP to demonstrate use of static data members and static member function.

Write a program to implement inheritance shown below. Assume suitable member functionCreate
two object

Explain multiple inheritance with suitable example.

What are the differences between inheriting a class with public & private visibility mode. What is
significance of protected.

Write a c++ program that illustrate how to achieve runtime polymorphism using virtual function.

Write a program to illustrate the concept of exception handling.

Explain stream classes and stream class hierarchy for input /output

Write a program for virtual base class operation.

Write a c++ program to read a file name and display the content of file on screen

Write a short note on “I/O manipulation”


Difference between obiect oriented programming and procedure oriented programming .

What do you mean by function with default parameters ?Explain it with programming example .

Write a program to create a class DATE having data members DD,MM,YY. i) constructor to
initialize the data members ii) show () to display date iii) overload ++ operator to increment
dat
e by one day iv) overload – operator to decrement date by one day .Consider one month =30 days
Write a program to swap two numbers using call by value & call by reference.

Describe data types in C++ in details.

Write a program in C++ check whether the given no is prime or not

Explain all types of constructor with programming example .

Explain with example how can a class template be created.

Explain the concept of command line arguments with example.

What does inheritance means in C++ ?What are differentforms of inheritance ?Give an ex
ample of each

What do you mean by function overriding ?Explain with programming example.

Explain the concept of visibility mode in inheritance with example .

Explain functions seekg, seekp, tellg ,tellp. Give proper example which show how they are used
for setting pointers during file operation
Write short note on (any three)
a)Static & dynamic binding
b)Virtual base class
c)Manipulators
d)Exception Handling

Explain concept of friend function with suitable example.

Explain recursive function. Write program to calculate factorial of number.

Write a C++ program to read employee details, such as empid, name, dept, salary , joining date for
10 employees. Make use of array of object.

What are abstract classes? Explain with suitable example.

Write a program in C++ to overload preincrement and post increment operator using friend
function.
Explain concept of constructor overloading.

Write a program in C++ to demonstrate use of multiple inheritances.

What is inheritance ? What are its advantages & disadvantages?

What is meant by virtual base class?

Define exception.

List out some important manipulator.

What is difference between static and dynamic binding?

How to detect end of file?

How parameters are passed to base class constructor?

Define dynamic object?

What do you mean by template instantiation?

What is polymorphism? Explain its types with example.

What is containers and containership? How it differs from inheritance?

Write a C++ program to implement template to find minimum of two data


items of type int, float, char and double.

Explain stream class hierarchy in detail.

Write a program in C++ to demonstrate the hierarchy of execution of default constructor &
destructor in multilevel inheritance.

Write a program to demonstrate multiple exceptions.

What are the rules for virtual function?

Explain the following functions.


1)seekg ()
2)seekp ()
3)tellg ()
4)tellp ()

You might also like