0% found this document useful (0 votes)
46 views7 pages

Q Bank

The document is a comprehensive question bank on Object-Oriented Programming in C++, covering various topics such as data types, constructors, inheritance, polymorphism, exception handling, and file I/O. It includes multiple questions that require explanations, examples, and C++ program implementations for concepts like virtual functions, operator overloading, and class structures. The content is structured to facilitate learning and assessment of key OOP principles in C++.

Uploaded by

king beast
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views7 pages

Q Bank

The document is a comprehensive question bank on Object-Oriented Programming in C++, covering various topics such as data types, constructors, inheritance, polymorphism, exception handling, and file I/O. It includes multiple questions that require explanations, examples, and C++ program implementations for concepts like virtual functions, operator overloading, and class structures. The content is structured to facilitate learning and assessment of key OOP principles in C++.

Uploaded by

king beast
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Object oriented programming (Question Bank )

1. What is the need of data types in C++? Describe different data types along with their
representations and size in C++.
2. What are the different ways to define member functions of a class. What is the role of scope
resolution operator in the definition of member function?
3. What is the need of passing objects as arguments. Discuss different ways to pass objects as
arguments to a function.
4. Discuss default constructor and parameterized constructor with the help of an example in C++.
5. Write down the example of dynamic constructor in C++.

6. Write a C++ program demonstrating use of the pure virtual function with the use of base and
derived classes.
7. What is a user defined exception. Write down the scenario where we require user defined
exceptions.

8. . What is role of manipulators in C++. Write down different manipulators in C++.


9. Write a C++ program involving overriding of member function.
10. Write a C++ program involving input/output using overloaded operators << and >> and member
functions of I/O stream classes.
11. Write a C++ program involving working with a single file. Use ifstream and ofstream classes to
write and read the information to and from a file. Show how a file can be opened and closed.

12. Write a C++ program to update the contents of a file by accessing the contents randomly.
13. Explain public, private and protected access specifiers and show their visibility when they are
inherited as public, private and protected.
14. What is a virtual function? Write rules for virtual function. Explain wit example.
15. Explain friend function with example and list sum of the special properties of friend function.

16. Explain following with respect to C++ with examples.


17. 1)new operator 2) destructor
18. Define operator overloading? Explain how to overload unary operator and binary operator.
19. Q: Which operators cannot be overloaded? Write steps to overload + operator so that it can add
two complex numbers. Explain with example how can a function template be created.
20. What does inheritance means in c++? What are different forms of inheritance? Give an example
of each.

21. Define polymorphism and Explain Virtual functions with example. What is the difference
between static & dynamic binding?

22. What is Standard Template Library? How is it different from the C++ Standard Library?

23. Write C++ program to find sum of three integer float number using templet class.

24. What is exception handling ? Explain types of exception handling and explain suitable example.

25. Q: Write a C++ program to display names, roll nos and grades of 3 students who have appeared
in the examination. Declare the class of name, roll nos and grade. Create an array of class
objects. Read and display the contents of the array

……………………………………………………………………………………………………………
1 What is an object and class?

2 Explain the structure of C++ Program with an example

3 Define Operators, Evaluation of expressions

4 Define abstraction, encapsulation with syntax

5 Define inheritance and polymorphism.

6 What is recursion? Explain recursive with an example

8 Define inline function with example.

9 What are the disadvantages of procedural programming

11 a) Describe the object oriented programming features of C++?

b) Write a C++ program to generate Fibonacci series using recursion with member function

12 a) Explain types of program flow statements in C++?

b) Define inheritance and explain it with example.


13 a) Write a program to exchange values between two classes using friend classes

b) Distinguish between call by value and call by address with an

example

14 a) Differentiate between Structures and class? Give an example of each?

b) Explain the different types of data types used in C++ with

example.

15 a) What is Operator overloading? Write a C++ program illustrating overloading NEW and
DELETE operators?

b) Define array and explain about types of arrays in C++ with example.

16 a) Write a C++ program using Switch case.

b) Explain about the various types of access specifiers are used in C++

C++ Classes and Data Abstraction

1 How to create classes and objects in C++ with example.

2 Difference between static data member and static member functions.

3 Explain about static keyword?

4 Write the structure of class

5 Explain the concept of Data abstraction.

6 What is copy constructor, explain with example

7 Explain Constructor with syntax.

8 What are destructors? When they are called? What is their utility?

9 What is mean by implicit and explicit constructors

10 Define constant function.

11 a) What is Constructors? How many types of constructors are there?

b) Write a C++ program illustrating Queue data structure? Ensure your program contains
special member functions like

constructors, copy constructors and Destructors to create and destroy Queue objects?
12 a) Write a C++ program to calculate simple interest and compound interest

b) Explain the concept of Data abstraction with example

13 a) Write a C++ program to display names, rollnos and grades of 3 students whohave
appeared in the examination. Declare the class of name, rollnos and grade. Create an array of class
objects.

Read and display the contents of the array

b) Explain Constant member functions with example

14 a) Explain Static class members with example

b) Write a C++ program to implement static keyword and explain

15 a) What is a Friend class, explain with example.

b) Write a C++ program to find Armstrong number

16 a) Explain about the various types of access specifiers are used in C++, explain with
examples.

………………………………………………………………………………………………………………………………………………………………

Inheritance & Virtual Functions and Polymorphism

1 Define the Base and Derived classes

2 Define Virtual base class.

3 What are destructors? When they are called?

4 Differentiate between multilevel and hybrid inheritance

5 What are the rules for virtual functions

6 Define the Base and Derived classes

7 Defining a class hierarchy.

8 Write the significance of pure virtual functions in C++?

9 Define Abstract classes.

10 Write a note on virtual destructors.

11 a) Explain in detail about the static and dynamic binding.


b) Differentiate between virtual function and virtual class. Also explain the rules for virtual
function

12 a) Describe the three different inheritance behaviors achieved through the use of pure
virtual, ordinary virtual and non virtual functions?

13 a) What is inheritance? How does it enable code reusability, explain with an example?

b) Explain the different types of inheritances used in C++

14 a) Write a program to define virtual, non virtual functions and determine size of the object

b) What are virtual functions? Describe the rules for declaring virtual functions?

15 a) What is polymorphism in C++. Explain about its types with example

16 a) Write a C++ program to read the data of N employee

and compute Net salary of each employee (DA=52% of Basic and Income Tax (IT) =30% of the gross
salary).

b) Write a program to destroy the constructor.

1 Definte Overloading operators

2 Explain I/O using C functions

3 Explain Stream classes hierarchy

4 Define Stream I/O

5 Define File streams and list out them

6 Define String streams

7 Define functions of ios class

8 Define few special manipulator functions used to perform formatted IO in C++

9 Define few error handling functions

10 What are the several special functions that are used to perform formmated IO operations
located in iomanip.h headerfile.

Part – B (Long Answer Questions)


11 a) Explain File streams in C++

b) Explain String streams with example

12 a) Explain Stream classes hierarchy with example

b) Explain I/O using C functions with example

13 a) Why we use getline() and write () functions, explain with example

b) Error handling during file operations with example

14 Formatted IO using ios class members with example

15 Formatted IO using manipulators with example

16 a) Explain Operators Overloading in C++ with example

b) Write a C++ to illustrate the concepts of console I/O operations.

1 What do you mean by exception handling.

2 Discuss the benefits of exception handling.

3 Explain about rethrowing an exception.

4 Describe the role of keywords try, throw and catch in exception handling.

5 What do you mean by stack unwinding.

6 Discuss about exception objects.

7 What is rethrowing an exception

8 how exceptions are handled in C++

9 Explain multiple catch handlers.

10 Explain few C++ Standard Exceptions

11 a) Explain C++ Standard Exceptions and describe them

b) Write a C++ to illustrate the concepts of console I/O operations.

12 a) Explain Catching Exceptions with example

b) Write a program to solve sum of individual digits.

13 a) Explain Rethrowing Exceptions with example

b) Write a program to find Fibonacci series

14 a) Explain Exception specifications with explain


16 a) What is mean by Catching all the exceptions in C++, explain with example

You might also like