Assignment 8 - Software Engineering - New

You might also like

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

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

Software Engineering
Assignment-8
TYPE OF QUESTION: MCQ/MSQ
Number of questions: 10 Total mark: 10 X 1 = 10

For each of the following questions one or more of the given options are correct. Choose the
correct options.

QUESTION 1:
Which one of the following is true of unary association?
a. It is defined between multiple classes
b. It is defined on exactly one object
c. It is defined between multiple objects of the same class
d. It is defined between multiple objects of different classes
e. It has a constant arity of 1 exactly
Correct Answer: c. It is defined between multiple objects of the same class

Detailed Solution:

Unary association defined between multiple objects of the same class.

QUESTION 2:
Which of the following statements regarding relations among classes are FALSE?
a. Composition is a special type of aggregation
b. Aggregation is special type of binary association
c. Binary association is special type of aggregation
d. Binary association is a special type of N-ary association
e. N-ary association is a special type of binary association.

Correct Answer: c. Binary association is special type of aggregation


e. N-ary association is a special type of binary association
Detailed Solution:

N-ary association is a special type of binary association is false because binary association is a special type
of N-ary association. Also , Binary association is not special type of aggregation.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 3:
Which of the following mechanisms are deployed by the state machine formalism to overcome
the state explosion problem inherent to the finite state machine formalism?
a. Composite OR states
b. History states
c. Guards on transitions
d. Pseudo initial state
e. Composite AND states
Correct Answer: a. Composite OR states
e. Composite AND states

Detailed Solution:
Composite OR and Composite AND sates can overcome the state explosion problem.

QUESTION 4:
If a class has 5 state variables, and each of state variable can assume 4 discrete values, what is the
maximum number states that an object of the class can assume?
a. 20
b. 80
c. 256
d. 625
e. 1024
Correct Answer: e. 1024

Detailed Solution:
If a class has 5 state variables, and each of state variable can assume 4 discrete values, then the
maximum number states that an object of the class can assume is 4×4×4×4×4 = 1024.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 5:
Which one of the following best characterizes a sequence diagram?
a. A call graph illustrating all possible sequences of calls between class method
members
b. A typical sequence of calls between object methods on a time-line
c. A time-line illustrating the changes in inheritance and instantiation relationships
between classes and objects over time
d. A tree illustrating inheritance relationship between classes
e. Sequence in which an object changes state
Correct Answer: b. A typical sequence of calls between object methods on a time-line

Detailed Solution:
A sequence diagram captures how objects interact with each other. It also shows life line of all the
objects. So, option b. is the correct one. Please refer slide no. 35 to 37 of the week 8 lecture material.

QUESTION 6:
Which of the following UML diagrams should you use when allocating use-case behavior to
classes?
a. Sequence and communication diagrams
b. Use-case and activity diagrams
c. Sequence and activity diagrams
d. Class and deployment diagrams
e. State machine and activity diagrams
Correct Answer: a. Sequence and communication diagrams
Detailed Solution:
When we allocate use-case behavior to classes we draw sequence diagram for each use case and
also communication diagram. So, option a. is the correct.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 7:
Which one of the following can be said of a sequence diagram?
a. It is used to model the behavior of a single object when many use cases are executed
b. It is used to model the behavior of several objects when a single use case is executed
c. It is used to model the behavior of a single object when a single use case is executed
d. It is used to model the behavior of several objects when many use cases are executed
e. It is used to model how state changes occur in a state machine diagram

Correct Answer: b. It is used to model the behavior of several objects when a single use case is
executed

Detailed Solution:
Sequence diagram used to model the interaction between several objects for a single use case. So,
among all the options, option b. is the correct choice.

QUESTION 8:
Consider the following sequence diagram for the borrow book use case.

Based on the sequence diagram, which methods will get allocated to the LibraryMember class.
a. borrow
b. borrowBook and borrow
c. borrowBook and canBorrow
d. borrowandcanBorrow
Correct Answer: c. borrowBook and canBorrow
Detailed Solution:
borrowBook and canBorrow are two methods assigned into LibraryMember class.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 9:
Consider the following C code.

Which one of the following is the state machine diagram corresponds to the given code?

a. A
b. B
c. C
d. D

Correct Answer: c. C
Detailed Solution:
The state machine diagram in C correctly depicts the above mentioned code. State is switching
from s2 to s1 on the event e3 and from s1 to s2 on the event e2.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

QUESTION 10:
Which one of the following UML class diagrams most accurately models: “Some persons keep animals as
pets.”

a. A
b. B
c. C
d. D

Correct Answer: a. A

Detailed Solution:
UML class diagrams shown in Option A correctly depicts the statement: “Some persons keep
animals as pets.”.

************END***********

You might also like