Unit Test OOPS C++

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Unit Tests - OOPS AND C++ [BCA-301]

[Unit -1]
1. Explain various access modes available in C++.
2. Explain friend function with example.
3. Write short notes on following:
(i) Data Abstraction
(ii) This pointer
4. Write a program by passing an object as function argument in C++.
5. Differentiate between following terms with suitable examples :
6. Abstraction and Encapsulation.

[Unit -2]

1. Write a program to find factorial of a number by using class object and function.
2. What is an inline function? Why it used in C++? Illustrate with an example.
3. Explain briefly characteristics of OOPS language and mention advantages of
OOPS approach over functional/procedural programming.
4. Write an interactive programming in C++. For swapping integers.
5. Function Overloading and Function Overriding.
6. Explain the steps involved in reading and writing a file in a C++ program?

[Unit -3]

1. What are the elements of object oriented Programming?


2. What are variables? List C++ rules for variables naming.
3. Differentiate between run-time polymorphism and compile-time polymorphism.
4. Justify the need of virtual function in C++.
5. Using the concept of function overloading, write a program in C++ to find the
maximum of three integer numbers.
6. Define the term virtual base class and its implementation in C++. How it is used
in function overriding?

[Unit -4]

1. What are objects? Describe the syntax for defining objects with example.
2. What are streams? Explain the features of C++ stream I/O with C’s I/O system.
3. The following functions are available in C++ to read a string
cin>>str
cin.getline(str,20)
4. where str is a string object. Explain their behavior.
5. What is visibility mode? What are the different inheritance visibility
modes supported by C++?
6. Define constructor. Explain various types of constructor in C++ with examples.
7. Write a program to overload a binary operator ‘+’ to add two complex numbers of
the form given as (a+ib).
8. Why is the friend function not allowed to access members of a class directly
although its body can appear within the class body

[Unit -5]

1. What are constructors and destructors? Explain how they differ from normal
functions.
2. What do you understand with virtual function?
3. What is exception handling? What is sequence of events when an exception
occurs?
4. Define inheritance. Explain various types of inheritance in C++ with examples.
5. What is runtime polymorphism? How virtual function can be used to implement
the runtime polymorphism? Explain wit the help of an example.
6. What are the differences between static binding and late binding? Explain
dynamic binding with a suitable example.

You might also like