0% found this document useful (0 votes)
41 views3 pages

Oops Previous Year Sawal

The document outlines the examination structure for Object Oriented Programming using C++, detailing two sections with specific questions for students to answer. Section A consists of five questions worth 5 marks each, while Section B includes three questions worth 15 marks each. The questions cover various C++ concepts such as classes, inheritance, operator overloading, and exception handling.

Uploaded by

dheerajdj2211
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)
41 views3 pages

Oops Previous Year Sawal

The document outlines the examination structure for Object Oriented Programming using C++, detailing two sections with specific questions for students to answer. Section A consists of five questions worth 5 marks each, while Section B includes three questions worth 15 marks each. The questions cover various C++ concepts such as classes, inheritance, operator overloading, and exception handling.

Uploaded by

dheerajdj2211
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/ 3

EXAMINATION, 2022-23

OBJECT ORIENTED PROGRAMMING USING C++


Note:
(i) Attempt any five questions from Section A and any three questions from Section B.
(ii) Answer each question of Section A within 50 words.
(iii) Limit your answers within the given answer book. Additional answer book (B-Answer
book) should not be provided or used.
Section-A
Note: Attempt any five questions. Each question carries 5 marks.

1. How Character Arrays are declared and initialized using pointers.

2. Describe pure virtual function in detail.

3. How does inline function differs with normal function in C++?

4. Define a constructor in C++ and explain its types.

5. Explain the concept of function template.

6. How a pointer can be used to pass arguments to a function by reference in C++.

7. Write a program to exchange values between two classes using friend classes.
Section-B
Note: Attempt any three questions. Each question carries 15 marks.

1. (a) What is a class in programming, and how is it used to create objects? Give an
example of how a class can be used to represent a car, with data members for
model, and year, and methods for accelerating and braking.
(b) Give an example of how polymorphism can be used to create a function that
can take multiple types of objects as input.

2. Write a C++ program that reads in a list of integers from the user, and print out
the maximum and minimum values in the list. The program should use a loop to
read in each integer, and should use variables to keep track of the maximum and
minimum values seen so far.

3. (a) Explain Inheritance & its types in detail. Give an example of how inheritance
can be used to create a subclass from a base class.
(b) Explain with example the various types of access specifiers that are used in
C++.
4. (a) Distinguish between call by value and call by address with proper examples.
(b) Write a program for overloading addition operator.

5. (a) Differentiate between virtual function and virtual class.


(b) Write a program to define virtual, non-virtual functions and determine size of
the object.

6. Describe any two of the following:


(i) Scope Resolution Operator with the help of a example program.
(ii) Explain the three foundational items of standard template library.
(iii) Destructor with the help of a sample program.

EXAMINATION 2023-24
OBJECT ORIENTED PROGRAMMING USING C++
Note:
(i) Attempt any five questions from Section A and any three questions from Section
B.
(ii) Answer each question of Section A within 50 words.
(iii) Limit your answers within the given answer book. Additional answer book (B-
answer book) should not be provided or used.
Section - A
Note: Attempt any five questions. Each question carries 5 marks.

1. Compare the basic concepts of Object Oriented Programming languages and


Procedural Programming languages.

2. Differentiate between call by value and call by reference in C++ with suitable
example.

3. Explain with proper syntax the Static data members and member functions used
in C++.

4. Explain the following with respect to C++ with examples.


i) new operator ii) destructor

5. Explain Protected inheritance with Example.

6. What is the difference between opening a file with constructor function and
opening a file with open () function.
7. Write a program in C++ that display entered string into reverse order.
Section - B
Note: Attempt any three questions. Each question carries 15 marks.

1. Which operators cannot be overloaded? Write steps to overload + operator so


that it can add two complex numbers. Also explain with example how can a
function template be created.

2. a) Explain various types of constructors with example.


b) Write a code to show the difference between operator overloading and
operator overriding in C++.

3. a) Write a program in C++ to demonstrate use of virtual function with appropriate


example.
b) Discuss with example the difference between static and dynamic binding in
C++?
4. a) What is a user defined exception. Write down different scenarios where we
require user defined exceptions.
b) Write a program which throw a division by zero exception and catch it in catch
block to handle this exception.

5. Write short notes on the following:


a) Object
b) Hybrid Inheritance
c) Friend function
d) Inline function

You might also like