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
_______________________________________________________________________________
QUESTION 1:
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. canBorrow
c. borrowBook and canBorrow
d. borrow, borrowBook, and canBorrow
e. borrow and canBorrow
Correct Answer: c. borrowBook and canBorrow
Detailed Solution:
The methods entering to (inward arrow) the LibrabyMember class will be allocated to it.
_______________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
_______________________________________________________________________________
QUESTION 2:
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 time‐line illustrating possible sequence of calls made among object methods
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. A graph indicating the sequence of state changes during a use case execution
Correct Answer: b. A time‐line illustrating possible sequence of calls made among object
methods
Detailed Solution:
Sequence diagram is the time‐line illustration of possible sequence calls made among the
object methods in a use case.
_____________________________________________________________________________
QUESTION 3:
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 composite structure diagrams
e. State chart and class diagrams
Correct Answer: a. Sequence and communication diagrams
Detailed Solution:
When allocating use‐case behavior to classes, you're essentially figuring out:
● Which classes perform which responsibilities, and
● How objects interact to realize a use case
_______________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
_______________________________________________________________________________
QUESTION 4:
Given the statement: "All rectangles are polygons, but not all polygons are rectangles," what is the
most appropriate object‐oriented relationship between the Rectangle and Polygon classes?
a. Aggregation
b. Inheritance, with Polygon as the subclass of Rectangle
c. Inheritance, with Rectangle as the subclass of Polygon
d. Composition
e. Association
Correct Answer: c. Inheritance, with Rectangle as the subclass of Polygon
Detailed Solution:
Rectangle is a Polygon, But Polygon is not necessarily a Rectangle. This represents an
inheritance(is‐a) relation.
_______________________________________________________________________________
QUESTION 5:
Consider the statement: “A bank allows its customers to open several types of accounts such as
saving account, current account, deposit account, and loan account.” What can be said about the
relationship that exists between the Account class and Loan Account class?
a. Inheritance
b. Aggregation
c. Composition
d. Dependency
e. Association
Correct Answer: a. Inheritance
Detailed Solution:
savings, current, deposit, and loan — are specialized forms of a general Account. This implies an
“is‐a” relationship
_______________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
_______________________________________________________________________________
QUESTION 6:
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 is defined between two different classes with multiplicity of one
Correct Answer: c. It is defined between multiple objects of the same class
Detailed Solution:
A unary association (also known as reflexive association) is an association within the same
class, i.e., between objects of the same class.
_______________________________________________________________________________
QUESTION 7:
Which one of the following can be said of the typical use 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 the states and transitions among the states
Correct Answer: b. It is used to model the behavior of several objects when a single use case is
executed
Detailed Solution:
A sequence diagram in UML:
● Focuses on object interactions in a time sequence.
● It shows how objects collaborate by sending messages to each other to accomplish a
behavior described by a single use case or scenario.
● Each object is represented with a lifeline, and interactions (method calls, returns, etc.) are
shown as messages along the timeline.
________________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
_______________________________________________________________________________
QUESTION 8:
A library automation software is to be designed. Before a book can be issued to a member, it needs
to be checked whether the member has cleared all past dues. Which one of the following
mechanisms is most appropriate to factor the issue book use case into reserve book and check
pending dues use cases?
a. Inheritance
b. Dependency
c. Include
d. Extend
e. Aggregation
Correct Answer: c. Include
Detailed Solution:
In Use Case Modeling, the <<include>> relationship is used when one use case always uses the
behavior of another use case as part of its process.
_______________________________________________________________________________
QUESTION 9:
Which one of the following is true of an object‐oriented design solution incorporating a deep
inheritance hierarchy?
a. It is a sign of a good design as it increases reuse
b. It is a sign of a good design as it leads to the realization of sophisticated and
versatile classes at the leaf level
c. It is a good design as it makes the most of the inheritance feature
d. It is a sign of good design as it increases the scope for additional polymorphic
bindings
e. It is a sign of bad design as it breaks encapsulation
Correct Answer: e. It is a sign of bad design as it breaks encapsulation
Detailed Solution:
A deep inheritance hierarchy in object‐oriented design is generally considered a sign of poor
design, as it breaks encapsulation.
_______________________________________________________________________________
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
_______________________________________________________________________________
QUESTION 10:
Consider the following UML sequence diagram. Based on the given sequence diagram, which one
of the following methods should be implemented by the Controller class?
a. register
b. register, checkDuplicate
c. register, showError, generateCIN
d. displayCIN, checkDuplicate, register
e. displayCIN, checkDuplicate, register, create
Correct Answer: c. register, showError, generateCIN
Detailed Solution:
The methods entering to (inward arrow) the Controller class will be allocated to it.
_______________________________________________________________________________