You are on page 1of 10

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

RAMAPURAM RAMAPURAM CAMPUS TUV


OSRM FACULTY OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OFCOMPUTER SCIENCE AND ENGINEERING
ODD
CYCLE TEST-I
Sub CodefName :21CSC101T -OBJECT ORIENTED DESIGN AND PROGRAMMING
Class :1Year /I Sem/B.Tech (CSE, AIML, I0T, BDA, CS AND IT)
Date : 20.02.2023
Max Marks :25 Duration: 60 mins

PART A (5 x1 =5)
ANSWERALLTHEQUESTIONS
Q.No Question Marks CO BL Pl

Which is the illegal statement from the following statement?


A) int *p; 1 1 2.3.1
B) strings, *sp-0;
C) int i; double *dp=&i;
D) int *pi-0;
ldentify the member that can never be accessed by inherited
2
classes? 2 2.3.1
A) Private member function
B}PubtiC member function
C)Protected member function
D)Publie-member function and Protected member function
In C++,a function contained within aclass is called-......
A)an operator
B)Menber function 1 3.3.1
C) aclass function
D)a method
How many bytes are occupicd by the following data types in a 32
bit system
4
|A)Type int 1 S.2.2
B) Type double
C) Type float
D)Type long
In UML diagrams which diagram captures system static structure
jand provide foundation for other models ----
A)Deployment diagram 2.1.2
B) Class diagram
C) Component diagram
D)Object diagram

PART B (2x 4= 8)
Answer any TW0 out of THREE questions
Q.No, Question Marks CO BL PI

List out the syntax of class, objects and methods and explain with 4 1 2.4.2
Example.
Describe the access specifiers used in C++. 4 1 2 5.4.2
8 Lllustrate the Use case diagram for an ATM Transaction process 4 2 3.4.2
PART C(1x 12= 12)
ANSWER THE FOLLOWING QUESTIONS
Q.No. Question Marks | CO BL PI
Implement the O0P's concept and write an program to display
9a) student details with regno, name and three subjcct marks and 12 3 5.3.1
calculate the average marks using class and objcct.
(OR)
9b)
Explain about the looping and control statements with an
suitable program 12 1 4 2.5.2
BL
I|T APURAM SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
SRM RAMAPURAM CAMPUS
FACULTY OF ENGINEERINGANID TECHNOLOGY
DEPARTMENTOF COMPUTER SCIENCE AND ENGINEERING
CONTINUOUS LEARNING ASSESSMENT-2
ACADEMIC YEAR (2022-23)
Sub Code/Name 21CSC101T/Object Oriented Design and Set ODD
Programming
Year/Sem/Branch /I/ CSE and Specialization Date |31.03.23
Max. Marks 50 Duration 1.30 IHour
PART A (10X 1=10)
ANSWER ALL THE QUESTIONS
Q.No. MCQ Questions Marks Co BL PI
What happens if a user forgets to define a constructor inside a
class?
a) Error occurs
1. b) Segmentation fault 1 1.2.1
c) Objects are not created properly
d) Compiler provides a default constructor to avoid
faults/errOrs
Destructor has a same name as the constructor and it is
preceded by?
a. !
2. 1
b, ~ 2 L2.1
c. $
d. ?
Which of the following is the perfect set of operators that
can't be overloaded in CPP?
3.
a. t=,?,::,>>
b. >>, <<, 2,*,sizeof) 1 2 12.1
c. ::,.,.,?:
d. :, ->, *, new delete
What will happen while using pass by reference?
a) The values of those variables are passed to the function so
that it can manipulate them
b) The location of variable in memory is passed to the
4. function so that it can use the same nemory area for its 1 2 1.2.1
processing
c) The function declaration should contain ampersand (& in
its type declaration)
d) The function declaration should contain $
Interaction Diagram is a combined term for
a. Sequence Diagram + Collaboration Diagram
5. b. Activity Diagram + State Chart Diagram 1 2 1.2.1
c. Deployment Diagram + Collaboration Diagram
d. Component Diagram + Deployment Diagram
Which anmong the following is correct for multiple
inheritance?
a) class student {public: int marks;}s; class stream {int total;};
6. class topper:public student, public stream{ }:
b) class student {int marks;}; class stream{ }; class topper: 3 1.2.1
public student{}:
c)class student{int marks;};class stream:public student{ }:
d) class student{}; class stream{; class topperf}:
7. Which feature of OOP indicates code reusability? T32|12.1
a. Abstraction
b. Polymorphism
c. Encapsulation
d. Inheritance
Which is uscd to create a pure virtual function?
a) $
8. b) =0 1 3 2 1.2.1
c) &
d) !
What is an inline function?
a) Afunction that is expanded at each call during execution
9. b) A function that is called during compile time 1 3 1.2.1
c) A function that is not checked for syntax errors
d) A function that is not checked for semantic analysis
Activity diagram, use case diagram, collaboration diagramn
and sequence diagram are considered as types of
10. a) non-behavioral diagrams
1 3 2 1.2.1
b)nonstructural diagrams
c) structural diagrams
d) behavioral diagrams

PART B (4 X4 =16)
ANSWER ANYFOUR OUT OF SIX QUESTIONS
Q.No. Questions Marks CO BL PI
Why does copy constructor accept the objects by reference 4 2 4 2.3.1
and not by value?
1Z. Write short noteson function overloading. 4 2 2.3.4
13. Illustrate about types of message in sequence diagram 4 2 3.1.1
14.
Differentiate between public, private and protected
4 3 4 3.2.1
inheritance using suitable examples.
18. What is an abstract class? Give example. 4 4 4.3.2
16. Outline the basic components of state chart diagram. 4 2.3.2

PART C(2 X 12 =24)


ANSWER ALL THE QUESTIONS
Q.
No. Questions Marks CO BL PI
a) Define Constructor. Write a C++ program by using classes 12
to show the sum of array rows and columns.You must write 2 3 3.1.1
17. this program by using a constructor and do while loop.
(OR)
b) Construct UML Sequence and Collaboration diagram for 12 2 4.3.2
Hospital management system.
a) We want to calculate the total marks of each student of a
class in Physics,Chemistry and Mathematics and the average 12 3 33.1.1
marks of the class. The number of students in the class are
entered by the user. Create a class named Marks with data
members for roll number, name and marks. Create three other
18. classes inheriting the Marks class, namely Physics, Chemistry
and Mathematics, which are used to define marks in individual
12 3 4 2.3.2
subject of each student.
(OR)
b)Construct UML State Chart and Activity Diagram for Online
Railway Ticket Reservation System.

J620
RINAPURANT SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
SRM TW
RAMAPURAM CAMPUS
FACULTY OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CONTINUOUS LEARNING ASSESSMENT-III(2022-23) -EVEN SEM
Code/Neme 21CSCOTObject Grienteá Desigu and Set 0DD
Programning
Veasem/Branch |IA/CSE and Specialisation Date5-5-23
Net. Marks 50Marks Duration 90 Mins
PART A(10 X l= 10)
ANSWERALL THE QUESTIONS
Q.N MCQ Questions Marks CO BL PI

ldentißy the core element of UML in the below figure?

5.1.1

a) Node b) Interface c) Class d) Component


2. specifies additionaB detail about UML element.
a) Stcreotype b) container 4 1 |5.1.I
c) associative container d) data processing
3. type of program can be included in try block?
a) static memory allocation b) dynamic memory allocation 1 4 2.12
c) constant reference d) pointer
îemplate is a model that serves as a pattern for creating
obiects 4 2.1.2
a) Sirilar b) differentc) constant d) po'nter
3. Identify the validity of temp'ate parameters?
a) Inside that block only b) Inside the class 4 1 2.1.2
c) Whole program d) Inside the main clasS
For what type of objcct docs the container can be.
instantiated? 5 2 2.1.2
a) int b)float c)doublc d)any type of o'bject
7. What type of access does dequeue and vecior provide?
a)Linear access b)Parallel access | $! 2 2.2.1
c)Random access d)None of the mentioncd
8. Which are not full container classes in C++?
a)Sequcnce containcr b)Associative container 1 5 2 2.2.1
c)Container adaptor d)None of thec mentioned
9. What are Unordered Associative Containers?
a) Containers that implements data structures whiçh can be
accessedsequentially
b) Containers that implements sorted data.structures for fast 2.2.2
5
scarch in O(logn)
c) Containers that implements unsorted(hashed) data
structures for quick search in O(1)
d) Containers that implements data structures which can be
accessed non- sequentially
10. | How many categories, containers are divided? 2 2.2.2
a)l b)2 c)3 dy4
PART B(4X4=16)
QUESTIONS
ANSWER ANY FOUROUT OF SIX
Marks Co BL PI
Q.No. Questions
4 4 2 3.1.1
11. Define a template andtheir types ?

12.
Whai is a Pckage Disgran1? liustrate t wih e s able 4 5.3.!
examplc.
4 2.3.1
13. llustrate catch all staterments with a suitable examplc.
14. What are all functions supported by vector and define 4 5 2 2.3.1
them?

15. How to insert and delete clements from priority queue? 4 5 4 3.1.1
Write a suitable exan1plc program.
16. What are scquence Containers in C++ STL and explain 4 2.3.1
with suitable examplc?

PART C(2X 12 =24)


ANSWER THE FOLLOWING QUESTION
Q. No. Questions Marks Co BL PE
A)Write a program to demonstrate the concept of exceptions
in constructor and destructor 12 3 3.1.1

i7 OR
B) D1scuss in detai! on Conporent Diagram an
depBovient with . suitab!e exANgie. 5.3.1

A) What is the purpose of merge(), sort(), find) and count


functions of aalgorithm. Explain with suitable exanple. 12 3 3.1.!

18. OR
B) What are the types of containers and explain the
conceptof stack and queuc with suitable example 12 5 2s.1
B.Tech/ M.Tech (niegrated) DEGREE
EXAMINATION, MAY 2023
Second & Third Semester

21CSCI01T-OBJECT
(For the candidates
ORIENTELD DESIGN AND PROGRAMMING
Note:
odnited from the academic year 2022-2023 onwards)
(i) Part - A shouid be answered in OMR shect within first 40
to hal invigilator at the end of 40h minute. minutes and OMR sheet should be handed over
Part -B and Part-C should be answered in answer booklet.
Tine: 3 Hours
Max. Marks: 75

PART-A (20 x 1 20Marks) Marks BL Co PO

Answer ALL Questions


1. Which feature of OOP indicates code
(A) Abstraction
reusability?
(B) Encapsulation
(C) Inheritance (D) Polymorphism
2. Which of the following statement is true for the command: 1 2I 2
int f (float)
(A) fis a function taking an argunent (B) f is a function taking an
of type int and returning a argument of type float and
floating-point number returning an integer
(C) fis a function of type float (D) fis a function of type int
3. Identify the corect way to declare a constant data type using preprocessor 1 2 i 2
directive in C++?
(A) #define int a = 100 (B) #define a = 100
(C) #define int a 100 (D) #define a 100

4. Which of the following access specifier allows the user to inherit the private 1 I1 2
members of a class?
(A) Public (B) Protected
(C) Default (D) Private

5. What happens if a user forgets to define a constructor inside a class? 2 2 2

(A) Error occurs (B) Segmentation fault


(C) Objects are not created properly (D) Compiler provides a default
constructor to avoid faults /
errors

1
6. Which of the following permits function overloading on C++?
(A) Type of arguments (B) Number of arguments
(C) Type and number of arguments (D) Number of objects
1 2 1
7. Which of the following C++ operator(s) can be overloaded?
(A) Size operator (size of) (B) Conditional operator (?:)
(C) Arithmetic operator (+,-,*) (D) Class Member Access Operator
() 29MF2&3-21CSCi01T
Page I of 4
2 2 3
8. Sequence and collaboration diagrams are
(A) UML interection diagrams (B) UML static diagrams
(C) UML structural diagrams (D) UML implementation diagrams
I 2 3 2
9. ldentify what happens when a attempt is made to instantiate an object of an
abstract class.
(A) Success message (B) Warning message
(C) Compilation error (D) Objccts gets created
10. In multilevel iaheritance one class inherits 1 2 3 1
(A) Only from one class (B) More than one class
(C) Atleast one class (D) Asmany classes as required
11. The double line filied circle with pointing arrow is I I 3 3
(A) Start state (B) Final state
(C) Transition state (D) Composite state
12. An inline function is expanded during 1 1 3 2
(A) Compile time (B) Run time
(C) Never expanded (D) End of program
13. What are tempiates in C++? 1 2 4 2
(A) A feature that allows programmer (B) A feature that allows
towrite generic programs programmer to write specific
codes fora problem
(C) Afeature that aiiows programner (D) Afeature that does not add any
to make program modular power to the language
14. What is an exception in Ct program? I 2 4 2
(A) A problem that arises during the (B) A problem that arises during
execution of a program compilation
(C) Syntax error (D) Semantic error
15. is used to visualize the topology of the physical components of a 1 4 3
system.
(A) Class diagram (B) Sequence diagram
(C) Deployment diagram (D) Package diagram
16. The block identifies a block of code for which a particular exception 1 1 4 2
wiil be activated.
(A) try (B) throw
(C) catch (D) finally
17. How many components Standard Template Library (STL) has?
(A) I (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)
pointer
Iterators are like pointers that
points to an element inside the
Page 2 of4 container
z9MF2&3-21CSC101T
19, Which function is used to access the first element of an array class?
(A) front () (B) start()
(C) first () (D) back()
20. is aproccdure that is used to process the data containcd in containers. 1 2 5 2
(A) Algorithm (B) Iteralor
(C) Pointer (D) Object
PART - B(5 x 8 = 40 Marks) . Marks BL CO P0

Answer ALL Questions


Write a CPP program to calculate and display the area of arectangle. Create a 3 1 2
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
calcuiate the area and third function to display the area. Length and breadth
should be entered by the user.

(OR)
b. Draw the UML use case diagram for the library
management system. The
system wii! have two users Librarian and student
8 4 3

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.
. a. Write a CPP program to add and
subtract two complex numbers using 3 2 2
operator overloading concept.
(OR)
. Create the sequence and
collaboration
bank ATM system. The system starts the
diagram for withdrawal scenario in the 8 4 2 3

procedure for validating the card and accountprocess


by empioying a standard
hoider.
28. Write a CPP program to
heip of virtual functions. differentiate early binding and late binding with the 8 3 3 2

(OR)
b. Draw the activity diagram with
The passenger should be abie toswim lanes for railway reservation system.
book ticket in online railway
8 4 3 3

system. The diagram should include fork, joint,


decision etc.
reservation
2Ka Write a CPP program to find the largest of two
templates. numbers using function 8 3 4 2

b. (OR)
Develop the components and deployment diagram for
online banking system. 8 4 4 3
d. Explain in detail about the
Libraries (STL). components that make up the Standard Template 8 3 5 4

(OR)
Page 3of 4
29MF2&3-21CSCi01T
of STL. stack with the STL. 4 s 4
b. Write a CPP program to demonsrate the working
functions.
Marke BL. CO PO
PART-C(1x15- 15 Marks)
Answer ANY ONE Question
15 4 2 2
3. Create a class named "Trianglc' with two private data members, base have and
height and one function to calculate the area of triangle. The class should
the folloving constructors:
(i) Having no parameter - values of both base and height are assigncd
zero

(iü) Having twoparaneters - to assign values to base and height


(iii) Heving 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.

15 3 3
27. Write a CPP program for the below mentioned hybrid inheritance scenario:
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. Finaliy, 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).

Page 4 of 4
29MF2&3-21 CSC101T

You might also like