Sa2
MCQ_lec7_Part2
1- The entity is responsible for a set of related tasks, one of which is
selected by the caller in each case.
a- Temporal
b- Procedural
c- Logical
d- Sequential
2- Example of _________ ‒ Module performing all input and output
a- Temporal
b- Procedural
c- Logical
d- Sequential
3- Why is logical cohesion so bad?
a- The interface is difficult to understand
b- Code for more than one action may be intertwined
c- Difficult to reuse
d-All of above
4- When related utilities which cannot be logically placed in other cohesive
units are kept together
a-Temporal
b- Procedural
c- Utility
d- Sequential
5- A utility is a procedure or class that has wide applicability to many
different subsystems and is designed to be reusable.
a-Temporal
b- Procedural
c- Utility
d- Sequential
6- For example of a/an_______ Cohesion, the java.lang.Mathclass.
a-Temporal
b- Procedural
c- Utility
d- Sequential
7- The entity is responsible for a set of tasks which have no good reason for
being together.
a-Temporal Cohesion
b- Procedural Cohesion
c- Coincidental Cohesion
d- Sequential Cohesion
8- The degree of dependence among system components
a- Cohesion
b- Coupling
c-all of the above
9- How can you tell if two components are coupled?
a- .class A has an associationwith that class B.
b- Generalizesor specializes class B
c- Have local variables of type B
d- Have parameters of type B
e- Have a return value of type B
f-All of the above
10- A network of interdependencies makes it hard to see at a glance how
some component works.
a-True
b-False
11- Changes in modules should not impact other modules; easier to work
with them separately
a-True
b-False
12- from disadvantages the Coupling If a class A depends on class B, and
we want to build a system that reuses class A, then we must also include
class B in the system, whether or not it would otherwise be needed.
a-True
b-False
13- If a class A depends on class B, and class B is modified, class A may
needn't to change as well.
a-True
b-False
Right Answer: If a class A depends on class B, and class B is modified,
class A may need to change as well.
14- __________is More interdependency,More Coordination and More
Information Flow
a- Tight Coupling
b- Loose Coupling
15- Less interdependency , Less Coordination and Less Information Flow
a- Tight Coupling
b- Loose Coupling
16-which of the following is the Type of Coupling
a-Content
b-Common
c-Control
d-Stamp
e-Data
f-All of the above
17- Occurs when one component covertly modifies data that is internal to
another component
a-Content
b-Common
c-Control
d-Stamp
e-Data
18- To reduce content coupling you should therefore encapsulate all
instance variables
a- declare them private
b-provide get and set methods
c-both a and b
19- Occur _________ When using a global variable / data block
a-Content
b-Common
c-Control
d-Stamp
e-Data
20- All the components using the global variable/data block become
coupled to each other
a-True
b-False
21- Usually, a poor design choice because
a-Lack of clear responsibility for the data
b-Difficult to determine all the components that affect a data element
(reduces maintainability)
c-Difficult to reuse components
d-Reduces ability to control data accesses.
e-All of the above
22- Occurs when one procedure calls another using a ‘flag’ or ‘command’
that explicitly controls what the second procedure does
a-Content
b-Common
c-Control
d-Stamp
e-Data
23- The use of polymorphic operations is normally the best way to avoid
______ coupling
a-Content
b-Common
c-Control
d-Stamp
e-Data
24- Occurs when too much information is passed to a function.
a-Content
b-Common
c-Control
d-Stamp
e-Data
25- When modules are relatively small and simple , then they are highly
cohesive.
a-True
b-False
26- When interactions among modules (classes) are relatively simple ,
they are loosely coupled.
a-True
b-False
27-With highcohesion and loose coupling , complex
systems become more manageable
a-True
b-False
28- Two modules are data coupled if they communicate by passing
parameters and no extra data are passed.
a-Content
b-Common
c-Control
d-Stamp
e-Data
باألخالق_والعلم_نرتقي#