0% found this document useful (0 votes)
9 views

Object Oriented Programming in C++

The document is an examination paper for the Object Oriented Paradigm with C++ course at Dr. Babasaheb Ambedkar Technological University, Lonere, for Winter 2018. It includes various questions related to algorithms, class diagrams, reference variables, constructors, polymorphism, inheritance, and exception handling, with instructions for students to solve specific questions. The exam consists of multiple sections where students must answer a selection of questions, each carrying a designated number of marks.

Uploaded by

kandhale25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Object Oriented Programming in C++

The document is an examination paper for the Object Oriented Paradigm with C++ course at Dr. Babasaheb Ambedkar Technological University, Lonere, for Winter 2018. It includes various questions related to algorithms, class diagrams, reference variables, constructors, polymorphism, inheritance, and exception handling, with instructions for students to solve specific questions. The exam consists of multiple sections where students must answer a selection of questions, each carrying a designated number of marks.

Uploaded by

kandhale25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

DR.

BABASAHEB AMBEDKAR TECHNOLOGICAL UNI\/ERSITY, LONERE


End Semester Examination - Winter 2018

Subject Name: Object Oriented Paradigm with C++ Subject Code: BTITC303
Max Marks: 60 Date:05/12l18 Duration: 3 Hr.
Instructions to tlte Studenls:
1. All que,stions are compulsory.
2. The level question/expected answer as per OBE or the Cottr,se Oulcome (CO) on
which lhe question is based is mentioned in front of the question.
3. Use of non-programmable scientific calctrlators is allowed.
4. A,ssume suitable data wherever nece,\sary.and mention it clearly.
(Level Marks
/co)
Q.I Solve Any Two of the following.
A) What is an algorithm? What is/are the need(s) of writing algorithm? COl 6

What is class diagram? What are the components of class diagram? Explain
with the help of diagram.
B) What is reference variable? What is its rnajor use? CO5 6

Write a function using reference variable as argument to sr,vap the values of pair
of integers.
C) i. Enumerate the rules of naming variables in C++. How do they diff-er fiom CO5 6

ANSI C rules?
ii. Describe the major parts of C++ program. How does a main function in C++

differ from rnain 0 in C?


Identify error in the following program
#include <iostream.h>
void main0
I
I

short i:2500, j:3000,


collt))" i +j :" >>-(i +j);
i
I

Q.2 Solve Any Two of the following.


A) A friend function cannot be Lrsed to overload the assignment operator:. COs 6

Explain why? When is a friend function compulsory? Give an example.

44527 06 A t5 C42C8064E A682D AF 4939 I C


B) What is constructor? Is it irrartclatory to use constructors in a class? gol,clo
we cC)3
invoke constructor function? List s.qme oflhe specialproperties of the
constructor functions. Can we use more than one constructor in a class? yes,
If
explain the need of such a situation.
C) What is type conversion?
c03
A class alpha has a constructor as follows: alpha (int a, double b);Can
we use
this constructor to conveft types?
We have two classes X and Y. If a is an object of X and b is an object
of y and
we want to say a:b; what type of conversion routine should be used
and
where?

Q.3 Solve Any two of the following.


A) i. what is a virtual function? why do we need virtual functions? when do we
c03
make a virtual function "pure"? what are the implications of making
a c04
function a pure virtual function?

ii. What is an exception? How is an exception handled in C++? What are the
advantages of using exception handring mechanism in a program?
when should
a program throws an exception?

B) what do you mean by function overloading? Explain with an example when


do co4
we use this concept.
on what basis, the compiler distinguishes between a set of overloaded

functions having the same name?


c) write a function to read a rnatrix of size m*n from the kevboard.
co2 6

Q.4 Solve Any Two of the following.


A) Distinguish between the following terms:
c02
i. Objects and classes
ii. Data abstraction and data encapsulation co3
iii. Inheritance and polymorphism
iv. Dynarnic binding and message passing
co4
co5
B) What does polymorphism rreans in C++ language? How polymorphism
c04
achieved at i. Compile time ii. Run time?
c) Define a class String. Use overload :: operator to compare two strings. c02

44 527 06 A t5 C42C8064E A682D AF 4939 I C


Q.5 Solve Any One of the following.
A) i. What does inheritance mean in C++? CO3 12

:'Class'DisderivedfromclassB.TheclassDdoeSnotcontainanydata
members of its own. Does the class D require constructors? If yes, why?

What is containership? How does it differ from inheritance?


Describe how an object ofa class that contains objects ofother classes created?
ii. What are the different forms of inheritance? Give an example for each.

iii. We know that a private member of a base class is not inheritable. Is it


anyway possible for the objects of a derived class to access the private
members of the base class? If yes, how? Remember, the base class cannot be

modified.
B) Creatstwociasses DMandDB which storesthe value of distances. DM stores CO2 12

distances in meter and centimeters and DB in feet and inches. Write a program
that can read values for the class objects and add one object of DM with

another object of DB.

Use friend function to carry out the addition operation. The object that stores

the results may be DM object or DB object, depending on the units in which the
results are required. The result should be in the format of feet and inches or
meters and centimeters depending on the object on display.

,rjrrr End r<rtrr

44s27 06 A1 5C42C8064EA682DA tr4939 I C


D
03 528 882 4E8 80F 025 5CF FED 23 384 4317
5 8 4E 0 0 C E 2 38 3 7
52 2882 24E 80F F02 25C FED D23 338 431 177B B59
F 4
28 8824 4E8 80F0 025 5CF ED 233 384 317 77B 59F F03
82 E8 0F 25 CF ED 23 84 31 7B 59 03 52
82 4E8 0F 025 CF ED 23 384 31 77B 59 F03 52 882
3 7 F 8
24 4E80 0F0 025C CFE ED2 233 843 317 7B5 59F 035 528 824 4E8
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F

(B)
(B)

(A)
(A)

Q.3
Q.2
Q.1
E8 0F 025 CF ED 233 84 317 7B 59F 03 528 82 4E8 0F 025
0 C E 2 3 5 5 4 0
80 0F02 25C FE D2 338 843 177 7B5 9F0 035 288 824E E80 0F0 25C CFE
F0 5C FE D2 33 43 17 B5 9F 35 28 24 8 F0 25 FE D
F0 25C FE D2 33 843 17 7B5 9F 035 28 824 E8 0F0 25 CFE D 233
8 7 0 8 0 C 2
02 25C FED D23 338 431 177B B59 9F0 352 288 24E E80 F02 25C FE D23 338 8431

data.
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77

it clearly
5C FE D2 338 43 177 B5 9F0 35 288 24 E80 F0 25C FE D2 338 43 177 B5

Date:- 02/12/2019
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035
33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28
84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80

Solve any Two.


B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25
03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 Instructions to the Students:
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31

Solve following questions.


02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
1. Each question carries 12 marks.

D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035


33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28

Attempt the following questions.


84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
Branch: B.Tech. ( Computer Engineering )

31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25
03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2
2. Attempt any five questions of the following.

24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035
33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28
84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
Subject: Object Oriented Programming in C++[ BTCOE404B]

31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
Fahrenheit and display it in Celsius.(formula=((f-32)/1.8))
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25
03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF

9F03528824E80F025CFED233843177B5
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035
3. Illustrate your answers with neat sketches, diagram etc., wherever necessary.

33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28


84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
WINTER SEMESTER (Supplementary) EXAMINATION Dec.-2019

9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 2


03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF
Mention advantages of object oriented approach over functional/procedural programming.

Why is it necessary to overload an operator? Write a c++ program to overload ‘+’operator.

0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF E
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E
Implement inheritance using following figure with member functions for reading and printing
Sem: IV

How do you define class in oop? Write a c++ program that will ask for a temperature in

5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D
Marks:60

FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2


D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 3
Time: 3 Hrs

33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233


84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23
06
06
06
06

31 7B 59 0 52 82 4E 0F 02 C ED 23 38
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE – RAIGAD -402 103

Marks

77 5 F0 35 88 4E 80 0 5C FE 2 38 4
4. If some part or parameter is noticed to be missing, you may appropriately assume it and should mention

B5 9F 35 28 24 8 F0 25 FE D2 33 43
9F 035 28 824 E8 0F0 25 CF D 33 84
03 28 82 E8 0F 25 CF ED 23 84 317
52 82 4E 0F 02 C ED 23 38 31
88 4E 80 02 5C FE 2 38 43 77
2 8 F 5 F D 3 4 17
D
03 528 882 4E8 80F 025 5CF FED 23 384 4317
5 8 4E 0 0 C E 2 38 3 7
52 2882 24E 80F F02 25C FED D23 338 431 177B B59
F 4
28 8824 4E8 80F0 025 5CF ED 233 384 317 77B 59F F03
82 E8 0F 25 CF ED 23 84 31 7B 59 03 52
82 4E8 0F 025 CF ED 23 384 31 77B 59 F03 52 882
3 7 F 8
24 4E80 0F0 025C CFE ED2 233 843 317 7B5 59F 035 528 824 4E8
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F

(B)
(B)
(B)
(B)

(A)
(A)
(A)
(C)
(A)

Q.6
Q.5
Q.4
E8 0F 025 CF ED 233 84 317 7B 59F 03 528 82 4E8 0F 025
0 C E 2 3 5 5 4 0
80 0F02 25C FE D2 338 843 177 7B5 9F0 035 288 824E E80 0F0 25C CFE
F0 5C FE D2 33 43 17 B5 9F 35 28 24 8 F0 25 FE D
F0 25C FE D2 33 843 17 7B5 9F 035 28 824 E8 0F0 25 CFE D 233
8 7 0 8 0 C 2
02 25C FED D23 338 431 177B B59 9F0 352 288 24E E80 F02 25C FE D23 338 8431
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77
5C FE D2 338 43 177 B5 9F0 35 288 24 E80 F0 25C FE D2 338 43 177 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F

exception.
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035

overriding.
33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28

c)size of file
84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25
03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33 a)Number of lines in file
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
b)number of words in file
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035
33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28

Attempt the following questions.


Attempt the following questions.
Attempt the following questions.
with suitable real time application.

84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25
03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2

Accept and display this data for five objects.


24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035
Write a c++ program to read data from file and display

33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28


84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 25

Elaborate concept of vector in c++ with suitable c++ program.


03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02 CF

9F03528824E80F025CFED233843177B5
Differentiate standard template library and c++ standard library.
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5C E
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F D 33
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF ED 23 384 31
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E 23 38 31 77
5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D2 38 43 77 B5
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2 33 43 17 B5 9F
What are the application of this pointer?explain with help of c++ program.

D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 33 843 17 7B 9F 035


33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233 84 17 7B 59F 03 28
84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23 84 31 7B 59 03 52 82

**********************End of Paper*********************
31 7B 59 0 52 82 4E 0F 02 C ED 23 38 31 77 59 F0 52 88 4E
77 5 F0 35 88 4E 80 0 5C FE 2 38 43 77 B5 F0 35 88 24 80
B5 9F 35 28 24 8 F0 25 FE D2 33 43 17 B5 9F 35 28 24 E8 F0
A template is considered as kind of macro. Then what is difference between them.

9F 035 28 824 E8 0F0 25 CF D 33 84 17 7B 9F 03 28 824 E8 0F 2


03 28 82 E8 0F 25 CF ED 23 84 317 7B 59 03 52 82 E 0F 02
52 82 4E 0F 02 C ED 23 38 31 7B 59 F0 52 88 4E 80 02 5
88 4E 80 02 5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C
24 80 F0 5C FE D2 33 43 17 B5 9F 35 28 24 E8 F0 25 F
E8 F 25 F D 33 84 17 7B 9F 03 28 82 E8 0F 25 CF
0F 025 CF ED 23 84 31 7B 59 03 52 82 4E 0F 02 CF E
02 C ED 23 38 31 77B 59 F0 52 88 4E 80 02 5C E
Define the term virtual base class and its implementation in c++.How it is used in function
Define virtual function. Compare compile time polymorphism and run time polymorphism

How is exception handled in c++? Elaborate your answer with array index out of bound

Write a c++ program to declare class mobile having data members as price and model number.

5C FE 2 38 43 77 5 F0 35 88 24 80 F0 5C FE D
FE D2 338 43 177 B5 9F 35 288 24 E80 F0 25C FE D2
D2 33 43 17 B5 9F 035 28 24 E8 F0 25 FE D 3
33 843 17 7B5 9F 035 28 824 E8 0F0 25 CF D 233
84 17 7B 9F 03 28 82 E8 0F 25 CF ED 23

06
06
06
06
06
06
06
06
06

31 7B 59 0 52 82 4E 0F 02 C ED 23 38
77 5 F0 35 88 4E 80 0 5C FE 2 38 4
B5 9F 35 28 24 8 F0 25 FE D2 33 43
9F 035 28 824 E8 0F0 25 CF D 33 84
03 28 82 E8 0F 25 CF ED 23 84 317
52 82 4E 0F 02 C ED 23 38 31
88 4E 80 02 5C FE 2 38 43 77
2 8 F 5 F D 3 4 17
10 D47 7D3 51C C36 413 541 E38 8D9 428 206
D D 5 3 41 54 E D 4 2 0
D4 47D 351 1C3 641 354 1E3 38D 942 2820 060DDA1
7 3 C 6 3 1 8 9 8 6
47 D35 51C 364 4135 541E E38 D94 428 206 0DAA10 0D4
D3 1C 36 13 41 3 D9 28 20 0D 1 D4 7D
7D 51 3 41 54 E 8D 42 2 60 A 0D 7 35
3 0 D 1 D
D3 351C C36 6413 3541 1E3 8D9 9428 820 60D A1 0D4 47D 351 1C3
5 4 5 E 8 4 6 A 0 3 C 6
35 1C3 3641 135 41E 38DD94 282 2060 0DA 10DD47 7D3 51C 364 4135
1C 64 35 41 38 9 28 06 D 10 4 D3 51 36 13 41

B)
B)
B)
B)
B)
B)
A)
1C 364 135 41 E38 D9 428 206 0D A10 D4 7D3 51 C36 413 541 E3
E 4 2 A 7 C 8

Q. 1

Q.5A)

Q.6A)
Q.4A)
Q.3A)
Q.2A)
C3 3641 1354 41E 38DD94 282 060 0DA 10DD47 D35 51C 364 4135 541E E38 D94
64 35 1E 38 94 282 060 DA 10 47 D3 1C 36 13 41 38 D9 28
36 13 41 3 D9 28 06 D 1 D4 D 51 3 41 54 E3 D 42 20
41 5 E 8D 4 2 0 A 0D 7 3 C 64 35 1 8 9 8 6
41 354 41E3 38D 942 2820 060DDA 10D 47DD35 51C3 364 135 41E E38DD94 4282 2060 0DA
35 1E 8D 94 82 60 A 10 47 3 1C 64 13 41 38 9 28 06 D 10
41 38 9 28 06 D 10 D4 D 51 36 13 54 E3 D 42 20 0D A1 D
E3 D 42 20 0D A1 D 7D 35 C3 41 54 1E 8D 94 82 60 A 0D 47
8D 942 82 60 A 0D 47 35 1C 64 35 1E 38 94 282 06 DA 10 47 D3
94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28 06 0D 10 D4 D3 51
28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20 0D A1 D 7D 51 C3
Marks:- 60
20 0D A1 D 7D 51 C3 41 54 E 8D 42 82 60 A 0D 47 35 C 64

iii) Vector
60 A 0D 47 35 C 64 35 1E 38 94 82 06 DA 10 47 D3 1C 36 13

i) Iterators
DA 10 47 D3 1C 36 13 41 38 D9 28 06 0D 1 D4 D 51 3 41 54
10 D47 D3 51C 36 413 541 E38 D9 428 206 0D A1 0D4 7D 351 C3 641 354 1E3
D4 D 51 3 41 54 E3 D 42 20 0D A1 0D 7D 35 C3 64 35 1E 8D

Solve the following.


7D 351 C3 641 354 1E 8D 942 82 60 A 0D 47 35 1C 64 135 41E 38 94
35 C3 641 35 1E 38D 94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28
1C 64 35 41 38 9 28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20
36 13 41 E3 D9 428 206 0D A1 D4 7D 51 C3 41 54 E3 8D 42 820 60D

ii) Container adaptors


41 54 E3 8D 42 20 0D A 0D 7D 35 C3 64 35 1E 8D 94 82 60 A

i) Objects and Classes


35 1E 8D 94 82 60 A 10 47 3 1C 64 13 41 38 9 28 06 D 10
41 38 9 28 06 D 10 D4 D 51 36 13 54 E3 D 42 20 0D A1 D
E3 D 42 20 0D A1 D 7D 35 C3 41 54 1E 8D 94 82 60 A 0D 47
Instructions to the Students:

8D 942 82 60 A 0D 47 35 1C 64 35 1E 38 94 282 06 DA 10 47 D3
94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28 06 0D 10 D4 D3 51
Subject Code : - BTCOE404B

28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20 0D A1 D 7D 51 C3
20 0D A1 D 7D 51 C3 41 54 E 8D 42 82 60 A 0D 47 35 C 64
60 A 0D 47 35 C 64 35 1E 38 94 82 06 DA 10 47 D3 1C 36 13

iii) Inheritance and Polymorphism


DA 10 47 D3 1C 36 13 41 38 D9 28 06 0D 1 D4 D 51 3 41 54

Write the following any two short notes


10 D47 D3 51C 36 413 541 E38 D9 428 206 0D A1 0D4 7D 351 C3 641 354 1E3
and should mention it clearly.
D4 D 51 3 41 54 E3 D 42 20 0D A1 0D 7D 35 C3 64 35 1E 8D

a) Distinguish between the following terms:


7D 351 C3 641 354 1E 8D 942 82 60 A 0D 47 35 1C 64 135 41E 38 94
35 C3 641 35 1E 38D 94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28

Explain virtual function with suitable example


1C 64 35 41 38 9 28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20

ii) Data abstraction and Data encapsulation


36 13 41 E3 D9 428 206 0D A1 D4 7D 51 C3 41 54 E3 8D 42 820 60D

END
What are the components of STL? Explain them.
41 54 E3 8D 42 20 0D A 0D 7D 35 C3 64 35 1E 8D 94 82 60 A
undefined

35 1E 8D 94 82 60 A 10 47 3 1C 64 13 41 38 9 28 06 D 10

Explain ‘this’ pointer with simple program example


2. Figures to the right indicates full marks.

using exceptions handling mechanism in a program?


41 38 9 28 06 D 10 D4 D 51 36 13 54 E3 D 42 20 0D A1 D

between run time binding and compile time binding?


Branch:- Computer Science and Engineering

E3 D 42 20 0D A1 D 7D 35 C3 41 54 1E 8D 94 82 60 A 0D 47
8D 942 82 60 A 0D 47 35 1C 64 35 1E 38 94 282 06 DA 10 47 D3
94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28 06 0D 10 D4 D3 51
Date:- 22/5/2019

28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20 0D A1 D 7D 51 C3
20 0D A1 D 7D 51 C3 41 54 E 8D 42 82 60 A 0D 47 35 C 64
60 A 0D 47 35 C 64 35 1E 38 94 82 06 DA 10 47 D3 1C 36 13
Subject :- Object Oriented Programming Using C++
RAIGAD -402 103

DA 10 47 D3 1C 36 13 41 38 D9 28 06 0D 1 D4 D 51 3 41 54
10 D47 D3 51C 36 413 541 E38 D9 428 206 0D A1 0D4 7D 351 C3 641 354 1E3

A10D47D351C36413541E38D94282060D
D4 D 51 3 41 54 E3 D 42 20 0D A1 0D 7D 35 C3 64 35 1E 8D
7D 351 C3 641 354 1E 8D 942 82 60 A 0D 47 35 1C 64 135 41E 38 94

Enlist header files in C++.Draw and explain stream class hierarchy.


35 C3 641 35 1E 38D 94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28
1C 64 35 41 38 9 28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20

What is operator overloading? Write the rules for operator overloading.


36 13 41 E3 D9 428 206 0D A1 D4 7D 51 C3 41 54 E3 8D 42 820 60D
41 54 E3 8D 42 20 0D A 0D 7D 35 C3 64 35 1E 8D 94 82 60 A
35 1E 8D 94 82 60 A 10 47 3 1C 64 13 41 38 9 28 06 D 10
41 38 9 28 06 D 10 D4 D 51 36 13 54 E3 D 42 20 0D A1 D
E3 D 42 20 0D A1 D 7D 35 C3 41 54 1E 8D 94 82 60 A 0D 47

(Given in meter and centimeter) using member functions and friend function.
8D 942 82 60 A 0D 47 35 1C 64 35 1E 38 94 282 06 DA 10 47 D3
5. Assume suitable data wherever necessary and mention it clearly.

94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9 28 06 0D 10 D4 D3 51

Write a program in C++ by using swap ( ) function from the functional template.
28 06 D 10 4 D3 51 36 13 41 E3 D9 42 20 0D A1 D 7D 51 C3
20 0D A1 D 7D 51 C3 41 54 E 8D 42 82 60 A 0D 47 35 C 64
Summer Semester(Regular) Examination May – 2019

60 A 0D 47 35 C 64 35 1E 38 94 82 06 DA 10 47 D3 1C 36 13
DA 10 47 D3 1C 36 13 41 38 D9 28 06 0D 1 D4 D 51 3 41 5 Write a menu-driven program for addition, subtraction, display result of two distances

How is Polymorphism achieved at a) compile time b) run time? What is the difference
10 D47 D3 51C 36 413 541 E38 D9 428 206 0D A1 0D4 7D 351 C3 641 354

What is an exception? How is an exceptions handle in C++? What are the advantages of
D4 D 51 3 41 54 E3 D 42 20 0D A1 0D 7D 35 C3 64 35 1
Semester :- IV

7D 351 C3 641 354 1E 8D 942 82 60 A 0D 47 35 1C 64 135 41E


35 C3 641 35 1E 38D 94 82 060 DA 10D 47 D3 1C 364 135 41
What is the role of constructor in C++? Explain various types of constructors with example.
3. Illustrate your answers with neat sketches, diagram etc., wherever necessary.

1C 64 35 41 38 9 28 06 D 10 4 D3 51 36 13 41 E3
1. Attempt any five questions of the following and each question carry 12 Marks.

36 13 41 E3 D9 428 206 0D A1 D4 7D 51 C3 41 54 E3
41 54 E3 8D 42 20 0D A 0D 7D 35 C3 64 35 1E 8
35 1E 8D 94 82 60 A 10 47 3 1C 64 13 41 38
________________________________________________________________________

41 38 9 28 06 D 10 D4 D 51 36 13 54 E3 D
Duration :- 3 Hours.

6
6
6
6
6
6
6
6
6
6
6
6
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE –

E3 D 42 20 0D A1 D 7D 35 C3 41 54 1E 8D 9
4. If some part or parameter is noticed to be missing, you may appropriately assume it

12

8D 942 82 60 A 0D 47 35 1C 64 35 1E 38 94
Marks

94 82 060 DA 10D 47 D3 1C 364 135 41 38 D9


28 06 D 10 4 D3 51 36 13 41 E3 D9 42
20 0D A1 D 7D 51 C3 41 54 E 8D 42
60 A 0D 47 35 C 64 35 1E 38 94 82
DA 10 47 D3 1C 36 13 41 38 D9 28
10 D47 D3 51C 36 413 541 E38 D9 428 20
D4 D 51 3 41 54 E3 D 42 20
7D 351 C3 641 354 1E 8D 942 82 60
6 3 0
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Winter Examination – 2022
Course: B. Tech. Branch :Computer Engineering Semester :III
Subject Code & Name: BTCOC305(A) Object Oriented Programming in C++
Max Marks: 60 Date: Duration: 3 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) State the need of object oriented programming and any two characteristics of Remember 6
C++.
B) What is constructor? Explain Parameterized constructor. Understanding 6
C) Explain objects as function arguments in C++ with suitable example. Apply 6

Q.2 Solve Any Two of the following. 12


A) Write a C++ program for Binary operator overloading for addition of two Apply 6
complex numbers.
B) Explain data conversion for primitive data type to user-defined type with Understanding 6
C++ program.
C) Explain different types of Inheritance in C++. Remember 6

Q. 3 Solve Any Two of the following. 12


A) What are Virtual functions? How it is differ from simple functions? Analysis 6
B) Illustrate this pointer with the help of C++ program. Apply 6
C) What is friend function? State its uses. Remember 6

Q.4 Solve Any Two of the following. 12


A) Explain Classes for I/O and File stream operations. Remember 6
B) What are manipulators in C++? Understanding 6
C) Write a C++ program to write contents in a file. Apply 6

Q. 5 Solve Any Two of the following. 12


A) What is exception? State its need of Exception handling. Remember 6
B) Explain function template overloading with C++ program. Apply 6
C) Explain sequence type container in C++. Understanding 6
*** End ***
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Winter Examination – March 2023
Course: SY B. Tech. Branch :Information Technology Semester :III
Subject Code & Name: (BTITC304) Object Oriented Paradigm with C++
Max Marks: 60 Date:15-03-2023 Duration: 3 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) Explain the following: Understand 6
1. Objects 2. Classes
3. Message Passing 4. Dynamic Binding
5. Polymorphism 6. Data Abstraction and encapsulation
B) Explain the difference between POP and OOP. Understand 6
C) What are the benefits of Object Oriented Programming? Explain it in details. Remember 6

Q.2 Solve Any Two of the following. 12


A) Explain memory management operator in C++ with suitable program. Understand 6
B) Explain objects as function arguments with suitable program. Understand 6
C) What is a friend function? What are the characteristics of a friend function? Remember 6
Explain it with one example.

Q. 3 Solve Any Two of the following. 12


A) What is a constructor? What are the characteristics of a constructor? What Remember 6
are the types of constructor?
B) What is inheritance? List and explain different types of inheritance. Remember 6
C) Write a C++ Program to display student Marksheet using multiple Create 6
inheritance.

Q.4 Solve Any Two of the following. 12


A) Write a C++ program for opening and closing a file using constructors. Create 6
B) Explain virtual function with suitable program. Understand 6
C) Write a C++ Program to display contents of text file. Create 6
Q. 5 Solve Any Two of the following. 12
A) What is an exception? How is an exception handled in C++? Remember 6
B) Explain how a try block involves a function that generates an exception with Remember 6
suitable program.
C) Explain how an exception is rethrown and caught with suitable program. Understand 6
*** End ***
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Supplementary Summer Examination – 2023
Course: B. Tech. Branch: Information Technology Semester: III
Subject Code & Name: (BTITC304) Object Oriented Paradigm with C++
Max Marks: 60 Date: 18-08-2023 Duration: 3 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) What is an Object-Oriented Design (OOD)? What are the advantages and Remember 6
disadvantages of OOD?
B) What is an Object Oriented Programming? Explain the benefits of Object Remember 6
Oriented Languages.
C) Distinguish between the following terms : Analyze 6
(i) Objects and Classes
(ii) Data abstraction and Data encapsulation
(iii) Inheritance and Polymorphism

Q.2 Solve Any Two of the following. 12


A) Explain the following with one example: Understand 6
(i) Switch statement (ii) For loop (iii) If else statement
B) What is a Friend function? What are the features of Friend function? Remember 6
Explain it with a suitable example.
C) Write a C++ program to add two matrices and print the resultant output. Create 6

Q. 3 Solve Any Two of the following. 12


A) What is virtual base class? When do we make a class virtual? Explain it with Remember 6
a suitable example.
B) What is a constructor? List and explain types of constructors. Remember 6
C) What is an inheritance? What are the different types of inheritance? Explain Remember 6
anyone with a suitable example.

Q.4 Solve Any Two of the following. 12


A) What is an operator overloading? Write a C++ program to overload unary Remember 6
operator.
B) Write a file handling program in C++ to write and read data from a file. Create 6
C) Write a C++ program to create a binary file by reading the data for the Create 6
students from the terminal. The data of each student consist of roll number,
name (a string of 30 or less number of characters) and marks.

Q. 5 Solve Any Two of the following. 12


A) What is Pure Virtual function? Explain it with a suitable example. Remember 6
B) What is an exception? How is an exception handled in C++? When is a Remember 6
catch (…) handler used?
C) Write a C++ program to divide one number by another number that throws Create 6
an exception when the divisor is 0.
*** End ***
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE
Regular & Supplementary Winter Examination-2023
Course: B. Tech. Branch : IT Semester : III
Subject Code & Name: BTITC304 (Object Oriented Paradigm with C++)
Max Marks: 60 Date:09-01-24 Duration: 3.00 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO) on
which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/ Mark
CO)
Q. 1 Solve Any Two of the following.
A) Explain basic concepts of OOP. understand 6
B) Write a C++ program that will ask for a temperature in Fahrenheit and create 6
display in Celsius.
C) Write a program for swapping of two numbers using call by reference. Create 6
Q.2 Solve Any Two of the following.
A) Explain Nesting of Member functions in C++. Understand 6

B) Explain Static Data member with suitable example. Understand 6


C) Write a suitable C++ program to illustrate the concept of an Array of objects. Create 6
Q. 3 Solve Any Two of the following.
A) Explain Dynamic Constructors with suitable program. Understand 6
B) Explain multilevel inheritance with suitable example. Understand 6
C) Explain Virtual Base classes with suitable program. Create 6
Q.4 Solve Any Two of the following.
A) Explain virtual functions with suitable program. Understand 6

B) Explain getline() and write() functions with program. Understand 6

C) Explain opening of files using open () function with suitable program. Create 6

Q. 5 Solve Any Two of the following.


A) Explain Exception handling mechanism in C++. Understand 6
B) Write a program to demonstrate the concept of rethrowing an exception. Create 6
C) Write a program to demonstrate catching and throwing of an exception using Create 6
the arithmetic expression

y = (a2+b2 )/ (a2- b2 ).

*** End ***

You might also like