Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

UID No:-___________

Course: BCA Semester/Batch: 2 /Jan 21


Sub. : Object Oriented Programming Sub. Code: 21ODBCT152
Time Allowed: 3 Hours Maximum Marks : 70
Note: 1. Question no. 1 is compulsory with 10 short questions (MCQs).
2. Attempt Two questions from Sections- B & C as per choices given.
(Each Answer should be between 800-1000 words)
Section – A (Compulsory) (10X1=10)
Q. 1 How structures and classes in C++ differ? (c) Overriding parts of program
(a) In Structures, members are public by default whereas, in Classes, (d) Wrapping things into single unit
they are private by default
(b) In Structures, members are private by default whereas, in 5. Who invented OOP?
Classes, they are public by default (a) Alan Kay
(c) Structures by default hide every member whereas classes (b) Andrea Ferro
do not (c) Dennis Ritchie
(d) Structures cannot have private members whereas classes can
have 6. Which keyword is used to define the user defined data types?
(a) Def
2. What does polymorphism in OOPs mean? (b) Union
(a) Concept of allowing overriding of functions (c) Typedef
(b) Concept of hiding data (d) type
(c) Concept of keeping things in different modules/files
(d) Concept of wrapping things into a single unit 7. Identify the correct statement.
(a) typedef does not create different types. It only creates synonyms
3. C++ is ______________ of existing types
(a) procedural programming language (b) typedef create different types
(b) object-oriented programming language (c) typedef create own types
(c) functional programming language (d) typedef will not create synonyms of existing types
(d) both procedural and object-oriented programming
language

4. What does modularity mean?


(a) Hiding part of program
(b) Subdividing program into small independent parts
8. Where does a cin stops it extraction of data
(a) By seeing a blank space
(b) By seeing (
(c) By seeing a blank space & (
(d) By seeing <

9. Which is used to get the input during runtime?


(a) Cout
(b) Cin
(c) Coi
(d) cinout

10. When will the cin can start processing of input?


(a) After pressing return key
(b) BY pressing blank space
(c) After pressing return key & BY pressing blank space
(d) BY pressing delete space
Section – B (30 Marks)

Q. 2 Explain constructor and destructor in detail.


OR

Q. 3 How to use try, throw and catch in single program, explain with suitable examples.

Q. 4 State the purpose of <iostream>. Write a C++ program to illustrate cin and cout stream.

OR

Q. 5 Illustrate the concept of encapsulation in C++ with the help of a program.

Section – C (30 Marks)


Q.6 Demonstrate the concept of Parametrized and Copy Constructors in C++ by writing a program.
OR
Q.7 Implement the concept of Function Overriding in C++ using suitable program.

Q.8 Explain the concept of Inheritance and its types. Draw suitable block diagrams.
OR

Q.9 Modify a program that opens a file and counts the whitespace-separated words in that file.

You might also like