10 Total Mark: 10 X 1 10: NPTEL Online Certification Courses Indian Institute of Technology Kharagpur
10 Total Mark: 10 X 1 10: NPTEL Online Certification Courses Indian Institute of Technology Kharagpur
10 Total Mark: 10 X 1 10: NPTEL Online Certification Courses Indian Institute of Technology Kharagpur
For each of the following questions one or more of the given options are correct. Choose the
correct options.
QUESTION 1:
QUESTION 2:
Which one of the following class diagrams is incorrect as per UML syntax?
a. A
b. B
c. C
d. D
e. Both B and D
Correct Answer: c. C
Detailed Solution:
QUESTION 3:
Consider the following sentence: “Every student of the college is a member of the library”. From
an analysis of the sentence, identify the relation between the Student and the Library classes that
can be inferred from the sentence.
a. Inheritance
b. Dependency
c. Aggregation
d. Composition
e. Association
Detailed Solution:
From the given statement, it can be inferred that there exists a aggregation relation between Student
class and Library class.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 4:
Consider the following sentence: “A linked list consists of many nodes such that each node is a
successor of some node and is the predecessor of some node”. From an analysis of the sentence,
which one of the following most accurately describes the relation among the instances of the nodes
of the linked list.
a. Inheritance
b. Association
c. Aggregation
d. Composition
e. Dependency
Detailed Solution:
The given statement in the question indicates a special kind of association relationship called as
Unary association.
QUESTION 5:
Consider the following sentence: “A library member can borrow upto five books”. From an
analysis of the sentence, identify the classes and relation between the LibraryMember and the
Book classes.
a. Inheritance
b. Association
c. Aggregation
d. Composition
e. Dependency
Detailed Solution:
In the given statement, there exists an Association relationship between LibraryMember and Book
class.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 6:
Consider the following statement: “India shares borders with Pakistan, Bangladesh, and China.”
Which one of the following is the best way to implement this in an object-oriented program?
a. Define a unary association on Country class
b. Let Country class implement the Border interface
c. Define Country class as an aggregate of Border classes
d. Define a dependency of Country class on Border class
e. Define a binary association between Country class and Border class
QUESTION 7:
Which is TRUE about the method tryIt() shown in the following class diagram?
a. The method tryIt() must be implemented by G1 and possibly also by G2, G3, and
G4.
b. The method tryIt() must be implemented by all of G1, G2, G3, and G4.
c. The method tryIt() must be implemented by only D1 and D2
d. There is no need for any class to implement tryIt(), it will be inherited
e. The method tryIt() must be implemented by all of D1, D2, G1, G2, G3, and G4.
QUESTION 8:
Consider that an Order consists of one or more Items. Each Item contains the name of the item,
its quantity and the date by which it is required. Each order item is described by an
ItemSpecification object having details such as its vendor addresses, unit price, and manufacturer.
What can be said about the relationship that exists between Item and ItemSpecification classes?
a. Dependency
b. Aggregation
c. Generalization-specialization
d. Composition
e. Association
QUESTION 9:
Consider the following class diagram. Which one of the following would be the most likely
implementation of the relationship between Car and Engine?
QUESTION 10:
Which one of the following UML diagrams models the structure of a system in terms of the classes,
their attributes, associations, and operations?
a. State diagram
b. Sequence diagram
c. Class diagram
d. Activity diagram
e. Use case diagram
Detailed Solution:
Class diagram models the structural view of a system in terms of the classes, their attributes,
associations, and operations.
************END***********