Unit 4 and 5 OODP QB
Unit 4 and 5 OODP QB
Unit 4 and 5 OODP QB
QUESTIONBANK
III SEMESTER
Regulation 2018
CO5 2
a) Node
b) Interface
c) Class
d) Component
25 Recognize the UML diagram shown below?
CO5 2
a) Component
b) Deployment
c) Use case
d) DFD
PART B (4 Marks)
1 What do you mean by Generic Programming? What are its advantages CO3 1
and state few applications?
2 Define a Class Template. Write a suitable example program. CO3 2
3 What is a Function Template? Illustrate with a suitable example
CO3 2
program.
4 What do you mean by Overloaded Function Template? What are the
CO3 1
rules to be followed to select a suitable template?
5 Distinguish between overloaded functions and function templates CO3 2
6 What is the need for template function in C++? What are the
advantages? CO3 1
7 Give the differences between Class template and Function template. CO3 2
8 What is an exception? How it is handled in C++? CO4 1
9 Write a program to demonstrate the concept of rethrowing an
exception. CO4 3
Ans:b
2 To what type of object does the container can be
instantiated?
a. int
b. float
CO6 BT1
c. double
d. any type of object
Ans:d
3 What type of class template is list?
a. Class-based
b. Node-based
CO6 BT2
c. Method-based
d. None of the mentioned
Ans:b
4 What type of access does deque and vector provide?
a. Linear access
b. Parallel access
CO6 BT2
c. Random access
d. None of the mentioned
Ans:c
5 Where does the vector add the item?
a. End
b. Insert
CO6 BT1
c. Middle
d. None of the mentioned
Ans:a
6 Which are not full container classes in C++?
a. Sequence container CO6 BT1
b. Associative container
c. Container adaptor
d. None of the mentioned
Ans:c
7 What is the lifetime of the element in container?
a. Whole program
b. Outside the block
CO6 BT1
c. Everywhere
d. Only on that container
Ans:d
8 Which operator is used to insert the data into file?
a. >>
b. <<
CO6 BT1
c. <
d. None of the Above
Ans: b
9
Which function is used to position back from the end of
file object?
a. seekg
b. seekp CO6 BT1
c. both seekg&seekp
d. None of the Above
Ans:a
10 How many objects are used for input and output to a
string?
a. 1
b. 2 CO6 BT2
c. 3
d. 4
Ans:c
11
Which is used to handle the exceptions in c++?
a. catch handler
b. handler CO6 BT1
c. exception handler
d. None of the Mentioned
Ans:c
12 Which type of program is recommended to include in try
block?
a. static memory allocation CO6 BT1
b. dynamic memory allocation
c. const reference
d. pointer
Ans:b
13 Which statement is used to catch all types of exceptions?
a. catch()
b. catch(Test t)
c. catch(…) CO6 BT1
d. None of the Above
Ans:c
Note:
2. CO – Course Outcomes
BT1 –Remember BT2 – Understand BT3 – Apply BT4 – Analyze BT5 – Evaluate BT6 – Create