8
23
ic-
Total No. of Questions—8] [Total No. of Printed Pages—3
t
9 sta
Seat
8:1
[5459]-186
01 91
No.
9:2
2/2 0
80
3/1 13
S.E. (Computer) (I Sem.) EXAMINATION, 2018
8 1 P0
OBJECT ORIENTED PROGRAMMING
.23 G
CE
(2015 PATTERN)
8
23
Time : Two Hours Maximum Marks : 50
ic-
16
tat
N.B. :— (i) Answer Q. Nos. 1 or 2, 3 or 4, 5 or 6 and 7 or 8.
8.2
9s
.24
(ii) Neat diagrams must be drawn wherever necessary.
8:1
91
49
9:2
(iii) Figures to the right indicate full marks.
30
80
(iv) Assume suitable data, if necessary.
01
01
2/2
GP
3/1
1. (a) What is dynamic memory allocation ? Explain its use in C++
CE
81
8
with a suitable example. [6]
23
.23
ic-
16
(b) What are primitive data types and User defined data
tat
8.2
types ? [3]
9s
.24
8:1
(c) What are inline functions ? What are their advantages ? [3]
91
49
9:2
30
Or
80
01
01
2. (a) Explain the use of explicit and mutable keywords with suitable
2/2
P
examples (hint : explicit is used with constructor and mutable
.23 G
3/1
is used with data member declaration). [6]
16 E
81
C
(b) Differentiate between compile time polymorphism and run time
polymorphism. [6]
8.2
P.T.O.
.24
49
8
23
ic-
3. (a) Write a template function that returns the average of all the
t
sta
elements of an array. The arguments to the function should
9
8:1
be the array name and the size of the array (type int). In
01 91
9:2
main( ), Exercise the function with arrays of type int, long,
2/2 0
80
3/1 13
double and char. [5]
8 1 P0
(b) How function overloading and function templates are related
.23 G
to each other ? State valid example to justify your answer. [4]
CE
8
(c) What are friend functions and static functions ? [4]
23
ic-
16
Or
tat
8.2
9s
.24
4. (a) Create a user defined exception to check whether your employee
8:1
91
49
exist in your data structure (use any data structure to store
9:2
30
the employees) and throw exception if name is not in the
80
01
01
employees list. Use the catch block to print an appropriate
2/2
GP
message on the screen. [5]
3/1
CE
(b) Explain various arithmetic pointer operations. [4]
81
8
23
.23
(c) What is generic programming ? How is it implemented in
ic-
16
tat
C++ ? [4]
8.2
9s
.24
8:1
91
49
9:2
5. (a) Write a program that returns the size in bytes of a program
30
80
entered on the command line : [6]
01
01
$ filesize program.txt
2/2
.23 G
P
3/1
(b) Write a program to create a file, read and write the record
16 E
81
C
into it. Every record contains Employee Name, Id, and Salary.
Store and retrieve at least 3 employee data. [7]
8.2
[5459]-186 2
.24
49
8
23
ic-
Or
t
sta
6. (a) Explain the following file handling functions : [10]
9
8:1
01 91
I. open( )
9:2
2/2 0
80
II. get( )
3/1 13
III. getline( )
8 1 P0
.23 G
IV. seekg( )
CE
V. tellg( )
8
23
ic-
(b) What is a Stream ? Explain types of Streams available
16
tat
8.2
in C++. [3]
9s
.24
8:1
91
49
9:2
7. (a) State functions of vector STL. Write a program to explain
30
80
the same. [6]
01
01
2/2
(b) Elaborate advantages and disadvantages of the following Basic
GP
3/1
Sequence Containers : [6]
CE
81
8
(a) Vector
23
.23
ic-
16
(b) List.
tat
8.2
9s
Or
.24
8:1
91
8.
49
(a) Write a program to implement Map using STL. [6]
9:2
30
(b) What is the STL ? Why should a C++ programmer be interested
80
01
01
in the STL ? What is the design philosophy of the STL ?
2/2
P
What are the major components of the STL ? [6]
.23 G
3/1
16 E
81
C
8.2
[5459]-186 3 P.T.O.
.24
49