0% found this document useful (0 votes)
16 views

OOADQuestion-lect2 ObjectOrientedParadigm

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

OOADQuestion-lect2 ObjectOrientedParadigm

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Concepts of Object Orientation and UML

Question 1. Why is encapsulation important? (Choose two)


A. It describes the relationship between two subclasses.
B. It places operations and attributes in the same object.
C. It allows other objects to change private operations and attributes of an object.
D. It prevents other objects from directly changing the attributes of an object.

Question 2. What are two functions of visual modeling? (Choose two.)


A. produces a single model that represents all views of the system
B. improves communication and comprehension among team members
C. documents important design decisions in the code
D. documents system behavior and structure before coding the system

Question 3. Which statement is true?


A. The UML is a development process for software intensive systems.
B. The UML is a process-dependent language used for visualizing software
artifacts.
C. The UML is a modeling language for software blueprints.
D. The UML is a visual programming language.

Question 4. In which three ways does a structured class differ from a


traditional class? (Choose three)
A. It clearly defines the class boundary via an encapsulation shell.
B. It brings public interfaces into the class via ports.
C. It shows the role that the class plays.
D. It defines messages between itself and other classes.

Question 5. Which is a characteristic of a structured class?


A. must have one interface for each role it plays
B. can play only one role, no matter how many objects transact with it
C. can play multiple roles that vary on the objects that interact with it
D. is limited to one role, but can have multiple interfaces

Question 6. Which two statements are true about interfaces? (Choose two)
A. The interface should have a clear purpose.
B. A single interface should include as many possible methods, if not all methods,
that may be shared by objects that implement the interface.
C. An interface should be used to restrict which methods are exposed to a client.
D. Classes may have multiple interfaces depending on the purpose of each
interface it implements.

1
Question 7. What is a named object in UML?
A. Matt:Employee
B. :Employee
C. Matt::Employee
D. ::employee

Question 8. An architect looks at two classes. The first class has the following
operations: getName(),getSize(),getTotal(), and findAverage(). The second
class has the following operations: getName(),getSize(), findAverage(),
findMinimum(), and findMaximum(). The two classes share the same
superclass. Which operations are most likely contained in the superclass?
A. getName(), getSize(), and findAverage()
B. findMaximum(), findMinimum(), getSize(), and getTotal()
C. getName(), findAverage(), and findMaximum()
D. getName(), getSize(), getTotal(), and findAverage()

Question 9. What does a required interface do?


A. exposes services to anonymous requestors
B. uses the services that a classifier requires to request from anonymous providers
C. declares the services that a classifier offers to provide anonymous requestors
D. exposes methods that the requestor must use

Question 10. What are two important considerations when diagramming


state? (Choose two.)
A. Any time a message is received; there may be a change of state.
B. Any time a message is received; there must be a change of state.
C. Whenever there is a change of state, there is a transition.
D. Changing state may not change transition.

Question 11. Which statement is true about circular dependencies?


A. They do not matter.
B. They are prohibited.
C. They must be avoided.
D. When there are more than two packages, they are irrelevant.

Question 12. Which statement is true about attributes?


A. They cannot change once the object is instantiated.
B. They change value from object to object of the same class.
C. They can only be primitives.
D. They are required for every class.

2
Question 13. Objects that are polymorphic _____.
A. must have the same attributes
B. share all the same operations, and the operations perform the same
C. can only be implemented through interfaces
D. may have the same operation names but the operations perform differently

Question 14. Which two characteristics do all objects have? (Choose two)
A. primitives
B. state and behavior
C. interfaces
D. a unique identity

Question 15. What happens when a superclass is changed?


A. All subclasses inherit the change.
B. The operations of the subclass must be changed.
C. Additional operations in the subclass that are not associated with the superclass
must change.
D. Only the operations of the superclass are inherited.

Question 16. Which state does NOT contain another state?


A. Top State
B. Composite State
C. Simple State
D. Bottom State

Question 17. Which statement is true about grouping elements into a


package?
A. Elements in a package should share a logical, common grouping.
B. Packages should contain a small number of elements to avoid confusion.
C. Packages should only be used on large projects requiring a large number of
elements.
D. Packages should not contain other packages.

Question 18. In a sequence diagram, what can be defined by the interactions


between participants in the interactions?
A. only services provided by an interface
B. only services required by an interface
C. both provided and required services for interfaces
D. the name of the interface

3
Question 19. Which statement is true about an active object?
A. It is an independent object that can communicate with other active objects
asynchronously.
B. It does not contain state.
C. It is dependent on the overall system execution.
D. It is unstructured to allow the class to be manipulated easily.

Question 20. Which two statements are true about interfaces?


A. The interface should have a clear purpose.
B. A single interface should include as many possible methods, if not all methods,
that may be shared by objects that implement the interface.
C. An interface should be used to restrict which methods are exposed to a client.
D. Classes may have multiple interfaces depending on the purpose of each
interface it implements.

Question 21. In a sequence diagram, each interaction on the diagram maps to


_____.
A. a choice point on a state diagram
B. the transition on a state diagram
C. a state on the diagram
D. the initial state

Question 22. In a state diagram, a state has two transitions. One of the
transitions is an internal transition and the other is an external transition.
Which state(s) can perform an exit action?
A. the internal transition only
B. the external transition only
C. neither the internal nor the external transition
D. both the internal and external transitions

Question 23. Which is a UML general-purpose mechanism for organizing


elements into groups?
A. a class diagram
B. an activity
C. a package
D. a composite diagram

4
Question 24 What is a gate?
A. a parameter that represents a message that crosses the boundary of an
interaction or interaction fragment
B. a defined protocol for accessing the internals of a subsystem
C. a decision point in a state machine that has more than two alternatives
D. a set of checkpoints each subsystem design must satisfy before it can be
assigned for implementation

Question 25. In the diagram, what is E?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

5
Question 26. In the diagram, what is H?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

Question 27. Which entity has a well-defined boundary and identity that
encapsulates state and behavior?
A. class
B. object
C. component
D. package

Question 28. In a dependency, through what reference does the client class
gain visibility to the supplier?
A. local reference
B. parameter reference
C. global reference
D. field reference

Question 29. A directed graph of nodes connected by transitions is a _____


diagram.
A. communication
B. sequence
C. component
D. state machine

6
Question 30. In the diagram, what is F?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

Question 31. In the diagram, what are C1 and C2?

A. forks
B. initial states
C. decisions
D. transitions
E. final states
F. events
G. states

7
H. guard conditions

Question 32. In the diagram, what is B?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

Question 33. In the diagram, what is A?

A. fork
B. initial state
C. decision
D. transition
E. final state

8
F. event
G. state
H. guard condition

Question 34. In the diagram, what is G?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

Question 35. In the below diagram, what is A?

A. fork

9
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

Question 36. In the diagram, what is D?

A. fork
B. initial state
C. decision
D. transition
E. final state
F. event
G. state
H. guard condition

You might also like