0% found this document useful (0 votes)
23 views4 pages

21CSC101T May 2023

21CSC101T

Uploaded by

pk6048
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)
23 views4 pages

21CSC101T May 2023

21CSC101T

Uploaded by

pk6048
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/ 4

32o59

Reg. No. RA 2 2 | 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 answered in OMR sheet within first 40
tohall invigilator at 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(20x1=20Marks) 1 1 1
1
Answer ALL Questions
1. Which feature of OOP indicates code 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
(A) fis a function taking an argument and
and returning argument of type float
of type int returning an integer
floating-point number
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) Segmentation fault
(C) Objects are not created properly (D) Compiler provides a default
constructor to avoid faults /
errors

6. Which of the following permits function overloading on 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) Conditional operator (?:)
(C) Arithmeticoperator (+,*/) (D) Class Member Access Operator
Page 1of 4
8. Sequence and collaboration diagrams are
1
(A) UML interaction diagrams (B) 2 2
(C) UML structural diagrams UML static diagrams
(D) UML implementation diagrams
9. Identify what happens when a
abstract class. attempt is made to instantiate an object of an 1 2 3
2
(A) Success message
(C) Compilation eror (B) Waming message
(D) Objects gets created
10. In multilevel
inheritance one 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 pointing arrow is 1
(B) Final state 1 3 3
(C) Transition state
(D) Composite state
12. An inline function is
(A) Compile time expanded during 1 1 3 2
(C) Never expanded (B) Run time
(D) End of program
13. What are templates in
(A) CH?
Afeature that allows programmer
to write generic (B) A feature that
1 2 4 2

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

(A) Class diagram


(C) Deployment diagram (B) Sequence diagram
(D) Package diagram
16. The block identifies a block of code for which a particular exception 1 1 4 2
will be activated.
(A) try (B) throw
(C) catch (D) finally
17. How many components Standard Template Library (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) Iterators are 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
.which function is used to access the first
(A) front () element of anarray class? 1 5 2
(C) first () (B) start()
(D) back()
20. is a procedure that isused to
process the data contained in containers. 1 2 5 2
(A) Algorithm (B) Iterator
(C) Pointer
(D) Object
PART -B(5 x 8= 40 Marks) Marks BL Co PO

Answer ALL Questions


a1 a Wite a CPP program to calculate and 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
Student functions: 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
operator overloading concept.
(OR)
8 4 2 3
b. Create the sequence and collaboration diagram for withdrawal scenario in the
bank ATM system. The system starts the process by employing a standard
procedure for validating the card and account holder.
8 3 3
23. a. Write a CPP program to differentiate early binding and late binding with the
help of virtual functions.

(OR) 8 4 3 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, decision etc.
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. Develop the components and deployment diagram for online banking system.
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
b. Write aCPP program to demonstrate the 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 calculate the area of triangle. The class should have
the following constructors:
() Having no parameter - values of both base and height are assigned
Zero
(ii) Having two parameters-to assign values to base and height
(iii) Having one parameter - assign value through parameter for base
and assign height = 4
(iv) Having a copy constructor to 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 mentioned hybrid inheritance scenario: 15 3
Create a class 'student' to get the student details. Inherit a class named
Marks' from 'Student' class to calculate the marks of students. Next,create a
class 'sports' to get the sports marks. Finally, create a class 'Result' inherited
from 'Marks' and 'sports' to calculate the overall result and average (overall
results will be from marks and sports marks).

You might also like