Thursday, September 22, 2022

R20 CPP UNIT WISE QUESTIONS

Note  :( These questions are just to put you in understanding level )

UNIT-1  

Differentiate between procedural and object oriented approach. (7M)

What is an object? How is it different from an ordinary variable and a class?
Explain with an example.

State the important features of object oriented programming. (7M)

Describe the major parts of C++ Program.

Compare object oriented programming with procedure oriented programming. 

Compare the features of C Programming language to that of C++ Programming
language.

Mention advantages and disadvantages of object oriented programming over
functional programming.

Explain the following concepts used in object oriented paradigm. Message
passing, code reusability.

What are the drawbacks of conventional programming? Explain how object oriented
programming overcome them.

Explain polymorphism, data abstraction and data encapsulation with examples.

List the drawbacks of conventional programming. Explain how object oriented
programming overcome them.

Explain about polymorphism and encapsulation.

List the similarities and differences between C and C++.

Write about inheritance and abstraction.

Explain the key concepts of Object Oriented Programming.

Briefly write about the evolution of C++.

UNIT-2

Write a C++ program demonstrating the viability of new and delete operators for a
single variable as well as an array.

How will you destroy the objects initialized by the constructor in the program?

With an example explain the syntax for defining a class. 

What is function overloading? What are the principles of function overloading?

How memory is allocated to an object? State with an example.

Write a C++ program to define two overloaded functions to swap two integers and to
swap two characters.

How the member function can be defined inside class and outside the class?
Explain.

Write a program in C++ to find the factorial of a given number using recursion.

What is static function? What is its use? How a member of class be declared as
static?

Write a C++ program to define three overloaded functions to swap two integers, swap two
floats and swap two doubles.

What are recursive constructors? Explain with an example.

Define inline function. Write a C++ program for finding the area of a triangle using
inline functions.

What is function overloading? What are the principles of function overloading?

Write C++ Program that demonstrates the usage of static data member and static
member function.

Write C++ program to find the area of a circle, rectangle and triangle using
function overloading.

What is a constructor? Write different rules associated with declaring constructors.

UNIT-3

What is operator overloading? Write the rule to overload an operator.

What are the various types of situations that might arise in data conversion
between incompatible types? How can they be handled? 
Explain the visibility of base class members for the access specifiers: private, protected
and public while creating the derived class and also explain the syntax for creating
derived class.

Write a C++ program to exchange the values between two classes using friend
functions.

Describe various visibility modes available in C++. 

With an example, explain the syntax for passing arguments to base class constructors in
multiple inheritances.

Write a C++ program to overload binary ‘+’ operator which will add two complex
numbers of the form (a+ib).

Write a C++ program to implement multiple inheritances with public access specific.

Write C++ program to find the area of a circle, rectangle and triangle using
function overloading.

What is a constructor? Write different rules associated with declaring constructors.

What are different types of inheritance supported by C++? Give an example for
each.

Write a C++ program to overload increment operator.

Write a C++ program to demonstrate pointers to base and derived classes. 

Discuss about virtual functions with a C++ example.

UNIT-4

With an example, explain how virtual functions are hierarchical.

How to create a virtual destructor? What is the necessity of making it virtual?

Describe the mechanism of creating virtual functions in C++ with an example.

Write a C++ program that declare and use pointer to an object.

How virtual functions can be used to implement runtime polymorphism? Describe.

What is a pointer? How to declare a pointer to a class and an object?

How does polymorphism promote extensibility? Illustrate.

With an example explain how late binding can be achieved in C++.

What is dynamic binding? How it is different from static binding? List some
advantages of dynamic binding over static binding.

What is a virtual destructor? Explain with an example.

Explain the role of this pointer in C++ with a programming example.

UNIT-5

Write a C++ program that illustrates exception handling with the help of
keywords: try, throws and catch.

What is STL? Briefly explain the use of containers, vectors, lists and maps.

What are class templates? How are they different from classes? Explain with
sample C++ code.

hat should be placed inside try block and catch block? When do you use
multiple catch handlers?

Write a C++ program to insert elements into a list. 

What is a container? Give its significance. Give an overview on its types.

Can we overload a function template? Illustrate with an example.

What is the sequence of events when an exception occurs? Explain them. 

How to initialize elements of vectors and lists? Illustrate. 

What is the use of Iterator while using containers? Justify with an example.

What are macros? How are they different from preprocessor directives and templates? (7M)

Write a program to swap two variables using a function template. 

Explain briefly the three foundational items of standard template library.

Write a C++ program to add two integers, two floating point numbers and two
complex numbers using class templates. 

Explain how to catch multiple exceptions in C++.

No comments:

Post a Comment