0% found this document useful (0 votes)
376 views6 pages

10 Total Mark: 10 X 1 10: NPTEL Online Certification Courses Indian Institute of Technology Kharagpur

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

NPTEL Online Certification Courses

Indian Institute of Technology Kharagpur

Object Oriented System Development Using UML, Java and Patterns


Assignment- 4
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:

In an informal (natural language) description of a programming problem, which parts of the


description are likely represent objects?
a. All of the nouns and some of the verbs.
b. All of the verbs and some of the nouns.
c. Some of the nouns
d. Some of the verbs
e. Some adverbs

Correct Answer: c. Some of the nouns


Detailed Solution:
Generally, the nouns presents in the natural language description of a programming problem
represent the objects.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

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:

Diagram C indicates a class inherits itself which is wrong.

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

Correct Answer: c. Aggregation

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

Correct Answer: b. Association

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

Correct Answer: b. Association

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

Correct Answer: a. Define a unary association on Country class


Detailed Solution:
As India, Pakistan, Bangladesh, and China are object of Country class. The statement defines a
unary association on the Country 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.

Correct Answer: c. The method tryIt() must be implemented by only D1 and D2


Detailed Solution:
As D1 and D2 are the child classes of Base class. They must implement the tryIt() method of the
Base class.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

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

Correct Answer: e. Association


Detailed Solution:
As each order item is described by an ItemSpecification, there exists an association relationship
between them.

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?

a. A field of type Car in Engine.


b. A class called CarEngine with one field of type Car and another field of type
Engine.
c. A field, of type Engine, in Car and a field, of type Car, in Engine
d. A field, of type Engine, in Car.
e. Creation of an instance of Engine in Car

Correct Answer: d. A field, of type Engine, in Car.


Detailed Solution:
The relationship between Car and Engine is: Engine is field of type Engine in Car class.
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur

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

Correct Answer: c. Class diagram

Detailed Solution:

Class diagram models the structural view of a system in terms of the classes, their attributes,
associations, and operations.

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

You might also like