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

OODP1

object oriented pdf file print and study

Uploaded by

tajjrajbir12345
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)
48 views

OODP1

object oriented pdf file print and study

Uploaded by

tajjrajbir12345
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/ 5

lOMoARcPSD|49945540

21CSC101T May 2023 QP

Object Oriented Design And Programming (SRM Institute of Science and Technology)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by rajbir ([email protected])
lOMoARcPSD|49945540

32o59
Reg. No. R A22|o
,MAY 2023
B.Tech/ M.Tech (Integrated) DEGREE EXAMINATION,
Second& Third Semester
PROGRAMMING
21CSC101T-OBJECT ORIENTED DESIGNTAND
2022-2023 onwards)
(For the candidates admitted from the academic year should be
handed over
Note: OMR sheet
minutes and
(i) Part- Ashould be answeredin OMR sheet within first 40
tohall invigilatorat the end of 40h minute.
(ii) Part - B and Part - C should be answered in answer booklet. Max. Marks: 75

Time: 3 Hours Marks BL CO PO

PART -A (20 x1=20Marks) 1 1 1


1
Answer ALL Questions
1. Which feature of OOP indicatescode reusability?
(B) Encapsulation
(A) Abstraction (D) Polymorphism
(C) Inheritance 1 2 1 2

true for the command:


2. Which of the following statement is
an
int f (float) (B) f is a function taking
taking an argument and
(A) fis a function argument of type float
of type int and returning
floating-pointnumber returningan integer
fis a function of type float (D) fis afunction of type int
(C) 1 2 1 2

the correct way to declare a constant data type using preprocessor


3. Identify
directive in C++?
(A) #define int a = 100 (B) #define a = 100
(D) #define a 100
(C) #define int a 100
1 1 1 2
4. Which of the following access specifier
allows the user to inherit the private
members of a class?
(A) Public (B) Protected
(C) Default (D) Private
1 2 2 2
constructor inside a class?
5. What happens if a user forgets to define a
(A) Error occurs (B) Segmentationfault
(C) Objects are not createdproperly (D) Compiler provides a default
constructor to avoid faults /
errors

6. Which of the followingpermits function overloadingon C++? 1 1 2

(A) Type of arguments (B) Number of arguments


(C) Type and number of arguments (D) Number of objects
7. Which of the following C+t operator(s)can be overloaded? 2
(A) Size operator(size of) (B) Conditionaloperator (?:)
(C) Arithmeticoperator(+,*/) (D) Class Member Access Operator
Page 1of 4
Downloaded by rajbir ([email protected])
lOMoARcPSD|49945540

8. Sequenceand collaborationdiagrams are


1
(A) UML interactiondiagrams (B) 2 2
(C) UML structuraldiagrams UML static diagrams
(D) UML implementationdiagrams
9. Identify what happens when a
abstractclass. attempt is made to instantiatean object of an 1 2 3
2
(A) Success message
(C) Compilationeror (B) Waming message
(D) Objects gets created
10. In multilevel
inheritanceone class inherits
(A) Only from one class (B) More than one class
1 2 3
(C) Atleast one class
(D) Asmany classes as
11. The double line filled
required
(A) Start state
circle with pointingarrow is 1
(B) Final state 1 3 3
(C) Transitionstate
(D) Compositestate
12. An inline function is
(A) Compile time expandedduring 1 1 3 2
(C) Never expanded (B) Run time
(D) End of program
13. What are templatesin
(A) CH?
Afeature thatallows programmer (B) A feature that
to write generic
1 2 4 2

allows
programs programmer to write specific
(C) A feature that allows codes for a problem
to make programmodularprogrammer (D) A feature that does not add
any
power to the language
14. What is an
exceptionin C++ program?
(A) A problem that arises during 1 2 4 2
the (B) A problem that arises
executionof aprogram compilation
during
(C) Syntax error (D) SemanticerrOr
15. is used to
system.
visualize the topology of the physical components of a 11 4 3

(A) Class diagram


(C) Deploymentdiagram (B) Sequencediagram
(D) Package diagram
16. The block identifiesa block of code for which a
will be activated. particularexception 1 1 4 2

(A) try (B) throw


(C) catch (D) finally
17. How many componentsStandardTemplateLibrary (STL) has? 1 1 5 1
(A) 1 (B) 2
(C) 3 (D) 4
18. What are iterators? 2 5 2
(A) Iterators are used to iterate over (B) Iteratorsare containers
functions
(C) Iterators are used to iterate over (D) Iterators are like pointers that
pointer points to an element inside the
container
Page 2 of4 29MF2&3-21CSC101T

Downloaded by rajbir ([email protected])


lOMoARcPSD|49945540

.whichfunctionis used to access the first


(A) front() element of anarray class? 1 5 2
(C) first () (B) start()
(D) back()
20. is a procedurethat isused to
process the data contained in containers. 1 2 5 2
(A) Algorithm (B) Iterator
(C) Pointer
(D) Object
PART -B (5x 8= 40 Marks) Marks BL Co PO

Answer ALL Questions


a1 a Wite a CPP program to calculateand display the area of a 3 1 2
rectangle. Create a 8
class with two private data members length and breadth and three functions.
First function to get the values of length and breadth, second function to
calculate the area and third function to display the area. Length and breadth
should be entered by the user.

(OR)
h Draw the UML use case diagram for the library management system. The 4 1 3

system will have two users Librarian and student with the following
functions.
Librarian functions: Add books, Add student, Add publication,Issue book,
Return book, Apply penalty,View report
Studentfunctions:Search book, Issue book, Return book, Penalty report,
Change password.
8 3 2 2
22.a. Write a CPP program to add and subtract two complex numbers using
operatoroverloadingconcept.
(OR)
8 4 2 3
b. Create the sequence and collaborationdiagram for withdrawalscenario in the
bank ATM system. The system starts the process by employing a standard
procedurefor validatingthe card and account holder.
8 3 3
23. a. Write a CPP program to differentiateearly binding and late binding with the
help of virtual functions.

(OR) 3
8 4 3
b. Draw the activity diagram with swim lanes for railway reservation system.
The passenger should be able to book ticket in online railway reservation
system. The diagram should include fork, joint, decisionetc.
3 4 2
24. a. Write a CPP program to find the largest of two numbers using function
templates.
(OR) 8 4 4 3
b. Developthe componentsand deploymentdiagram for online bankingsystem.
8 3 5
23. a. Explain in detal about the components that make up the Standard Template
Libraries(STL).
(OR)
Page 3of4 29MF2&3-21CSC101T

Downloaded by rajbir ([email protected])


lOMoARcPSD|49945540

b. Write aCPP program to demonstratethe working of STL stack with the STL 8 4

functions.
PART-C(1x 15 = 15 Marks) Marks BL

Answer ANY ONE Question

26. Create a class named Triangle' with two private data members, base and 15 4

height and one function to calculatethe area of triangle.The class should have
the followingconstructors:
() Having no parameter- values of both base and height are assigned
Zero
(ii) Having two parameters-toassign values to base and height
(iii) Having one parameter - assign value through parameter for base
and assign height = 4
(iv) Having a copy constructorto copy values of one object to another
Create objects for the classes and calculate the area of triangle and print the
area.

27. Write a CPP program for the below mentionedhybrid inheritancescenario: 15 3


Create a class 'student' to get the student details. Inherit a class named
Marks' from 'Student' class to calculatethe marksof students. Next,create a
class 'sports' to get the sports marks. Finally, create a class 'Result' inherited
from 'Marks'and 'sports' to calculatethe overall result and average (overall
results will be from marks and sports marks).

Downloaded by rajbir ([email protected])

You might also like