12
5/12/2014 From Modules to Objects ANSWERS http://www.mhhe.com/cgi-bin/netgrader.pl 1/12 From Modules to Objects Answers 1. Object-oriented concepts are not new. The first OO language was considered to be: Your response: A. ALGOL-68 Incorrect. The first OO language was considered to be SIMULA 67. Schach S7.1 p168 2. A lexically contiguous sequence of program statements, terminated by boundary elements, having an aggregate identifier. This is a definition of a: Your response: A. procedure Incorrect. The definition is broad enough to encompass procedures and functions of the classical paradigm as well as objects and their encapsulated method. Schach S7.1 p168 3. If software is not modular it is difficult to: Your response: A. correct Incorrect. If software is not modular it is difficult to understand and therefore difficult to correct. As the implementation is tied up to a specific design it will also be difficult to extend, enhance and reuse. Schach S7.1 p170 4. The degree of interaction within a module is known as: Your response: A. cohesion

From Modules to Objects ANSWERS

Embed Size (px)

DESCRIPTION

kkkkkkkkkkkkkkkkkkkkkkkkk

Citation preview

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 1/12

    From Modules to Objects Answers

    1. Object-oriented concepts are not new. The first OO language was considered to be:

    Your response: A. ALGOL-68

    Incorrect.

    The first OO language was considered to be SIMULA 67. Schach S7.1 p168

    2. A lexically contiguous sequence of program statements, terminated by boundary elements,having an aggregate identifier. This is a definition of a:

    Your response: A. procedure

    Incorrect.

    The definition is broad enough to encompass procedures and functions of the classicalparadigm as well as objects and their encapsulated method. Schach S7.1 p168

    3. If software is not modular it is difficult to:

    Your response: A. correct

    Incorrect.

    If software is not modular it is difficult to understand and therefore difficult to correct. As theimplementation is tied up to a specific design it will also be difficult to extend, enhance andreuse. Schach S7.1 p170

    4. The degree of interaction within a module is known as:

    Your response: A. cohesion

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 2/12

    Correct!

    The degree of interaction within a module is known as cohesion. Schach S7.1 p170

    5. The degree of interaction between two modules is known as:

    No response was registered by the student.

    6. A method of implementing common coupling is:

    Your response: A. the common statement in FORTRAN

    Incorrect.

    All of these are methods of implementing common coupling. Schach S7.3.2 p178

    7. The use of common coupling has an inherent limitation.

    Your response: A. The code is virtually unreadable

    Incorrect.

    The use of common coupling has many inherent limitations. Schach S7.3.2 p179

    8. Data encapsulation is an example of:

    Your response: A. generalisation

    Incorrect.

    Data encapsulation is an example of abstraction. Schach S7.4.1 p186

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 3/12

    9. Without __________________, the definition of an object as an instantiation of an AbstractData Type is too simplistic.

    Your response: A. polymorphism

    Incorrect.

    Without inheritance, the definition of an object as an instantiation of an Abstract Data Type istoo simplistic. Schach S7.7 p198

    10. A class is an Abstract Data Type that supports:

    No response was registered by the student.

    11. Why can't the Object-Oriented paradigm be directly implemented in classical languages suchas C, COBOL and FORTRAN?

    No response was registered by the student.

    12. Parent is a ____________ of HumanBeing.

    No response was registered by the student.

    13. ___________ refers to the components of a class:

    Your response: A. specialisation

    Incorrect.

    Aggregation refers to the components of a class. Schach S7.7 p199

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 4/12

    14. The relationship of some kind between two apparently unrelated classes is referred to as a(n):

    Your response: A. specialisation

    Incorrect.

    The relationship of some kind between two apparently unrelated classes is referred to as anassociation. Schach S7.7 p199

    15. The relationship between a derived class (or subclass) and base class is referred to as:

    Your response: A. association

    Incorrect.

    Association refers to a relationship between two apparently unrelated classes. Schach S7.7p199

    16. An act of connecting an object to the appropriate method is called:

    Your response: A. dynamic binding

    Correct!

    An act of connecting an object to the appropriate method is called dynamic binding. SchachS7.8 p202

    17. If a method can be applied to objects of different classes it is termed:

    Your response: A. dynamic

    Incorrect.

    If a method can be applied to objects to objects of different classes it is termed polymorphic.

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 5/12

    Schach S7.8 p202

    18. Why can polymorphism and dynamic binding have a negative impact on inheritance?

    Your response: A. This statement is not true. Like all object-oriented concepts

    polymorphism and dynamic binding make modules more cohesive and lower coupling.

    Incorrect.

    Polymorphism and dynamic binding make the object harder to understand as there aremultiple possibilities for a specific method. Schach S7.8 p203

    19. Myers (1978) identifies seven levels of cohesion. Which level of cohesion may be defined asfollowed; "the output from one element in the component serves as input for some other element"?

    Your response: A. None of these

    Incorrect.

    In communicational cohesion the output from one element in the component serves as inputfor some other element. Schach C7.2.5 p174

    20. Myers (1978) identifies seven levels of cohesion. Which of the following is the strongest form ofcohesion?

    Your response: A. Functional cohesion

    Incorrect.

    In the structured paradigm , the optimal level of cohesion is functional. Schach C7.2 Fig 7.4,p 171

    21. In FORTRAN the use of the COMMON block

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 6/12

    Your response: A. results in a high degree of coupling.

    Correct!

    Tight coupling occurs where components communicate through a shared data area. SchachC7.3.2 p178-

    22. Which of these characteristics should a good design have?

    Your response: A. The design should be the most maintainable

    Incorrect.

    All of these are characteristics of a good design.

    23. Myers (1978) identifies seven levels of cohesion. Which of the following cohesion levels hasthe highest strength?

    Your response: A. Procedural cohesion

    Incorrect.

    Communicational (also known as Sequential) cohesion has the highest strength compared toother cohesion levels except functional and informational. Schach C7.2.5

    24. How does inheritance in an object-oriented design affect its understandability?

    Your response: A. Inheritance affects understandability in both positive and negative ways.

    Correct!

    Inheritance may be used to conceal design details but as it spreads information around thedesign it also can degrade understandability. Schach C7.10 p204-

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 7/12

    25. Of the following the strongest level of cohesion in software design is:

    Your response: A. Sequential

    Incorrect.

    The levels of cohesion from weakest to strongest are: Coincidental, Logical, Temporal,Procedural, Communicational, Functional/Informational. Schach C7.2 Fig 7.4, p 171

    26. Which one of the following statements is FALSE?

    Your response: A. Function-oriented design and object-oriented design are

    complementary design strategies.

    Incorrect.

    Cohesion is the degree of interaction within a module. Schach C7.1 p170.

    27. Object-oriented languages are so effective for rapid prototyping because ___

    Your response: A. fewer Lines Of Code (LOC) are required to produce a Function Point

    (FP) than for other comparable languages.

    Incorrect.

    Object-oriented languages are so effective for rapid prototyping because the componentscan be readily adapted by creating new (sub-) components that inherit the atrtibutes andoperations of the original component. Only attributes and operations that need to be changedhave to be modified.

    28. A design is said to be a good design if the components are:

    Your response: A. Strongly coupled

    Incorrect.

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 8/12

    You should aim to maximize the interaction within a module and minimize the interactionbetween modules. Schach C7.1 p170.

    29. Cohesion is a measure of how closely the parts of a component relate to each other andCoupling is a measure of the strength of component interconnections.Designers should aim to produce:

    Your response: A. Strongly cohesive designs

    Incorrect.

    You should aim to maximize the interaction within a module and minimize the interactionbetween modules. Schach C7.1 p170.

    30. The two main design strategies are known as functional design and object-orientated design.Which of the following statements is false?

    Your response: A. In an object-orientated design the system state is decentralised and

    each object manages its own state information.

    Incorrect.

    The same design approach must be used in the design of different system components toensure consistency, especially for large software systems. Schach C7.10 p204-207.

    31. Which of the following levels of component cohesion strength is the lowest?

    Your response: A. Procedural cohesion.

    Incorrect.

    The levels of cohesion from weakest to strongest are: Coincidental, Logical, Temporal,Procedural, Communicational, Functional/Informational. Schach C7.2 Fig 7.4, p 171

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 9/12

    32. The measure of the closeness between components of any module is known as cohesion. Thecohesion in which the components are NOT related but are simply bundled is known as:

    Your response: A. Temporal cohesion.

    Incorrect.

    In coincidental cohesion there is no relationship between the components. Schach C7.2 p171

    33. Which of the following is NOT one of the seven levels of cohesion?

    Your response: A. Procedural cohesion

    Incorrect.

    There are seven levels of cohesion and object cohesion is not one of them. Schach C7.2 p171

    34. Communicational cohesion is where:

    Your response: A. components that perform similar functions such as input, error handling

    and so on are put together in a single component.

    Incorrect.

    Communicational cohesion - The output from one element in the component serves as inputfor some other element. Schach C7.2.5. p174

    35. Experience of object-oriented programming has shown that the inheritance network must beperiodically reviewed and restructured ____________ .

    Your response: A. to increase it's coupling and decrease its cohesion.

    Incorrect.

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 10/12

    Experience of object-oriented programming has shown that the inheritance network must beperiodically reviewed and restructured to reduce its complexity and functional duplication.Schach C7.10 p204-207.

    36. Which of the following levels of cohesion, as identified by Myers (1978), allows components toperform similar functions such as input and error handling to be put together into a singlecomponent?

    Your response: A. Temporal cohesion

    Incorrect.

    The cohesion of a component is a measure of the closeness of the relationships betweencomponents. Schach C7.2 p 171

    37. Temporal Cohesion is where:

    Your response: A. the elements in a component make up a single control sequence

    Incorrect.

    Temporal Cohesion is when all of the components that are activated at a single time arebrought together. Schach C7.2.3 p 173

    38. If a control switch is passed as an argument this is an example of _______ coupling.

    Your response: A. content

    Incorrect.

    Two modules are control coupled if one passes an element of control to another. SchachC7.3.3 p180

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 11/12

    39. If one module directly references the contents of another they are said to be _______ coupled.

    Your response: A. content

    Correct!

    Two modules are content coupled if one module directly references the contents of another.Schach C7.3.1 p178

    40. If a data structure is passed as an argument, but the called module operates on only some ofthe individual components of that data structure then they are said to be _______ coupled.

    Your response: A. content

    Incorrect.

    Two modules are stamp coupled if a data structure is passed as an argument, but the calledmodule operates on only some of the individual components of that data structure. SchachC7.3.4 p180

    41. If every argument is either a simple argument or a data structure in which all elements are usedby the called module then they are said to be _______ coupled.

    Your response: A. content

    Incorrect.

    Two modules are data coupled if all arguments are homogeneous data elements. That is,every argument is either a simple argument or a data structure in which all elements are usedby the called module. Schach C7.3.5 p182

    42. Which of the following is a type of abstraction?

    Your response: A. data

    Incorrect.

  • 5/12/2014 From Modules to Objects ANSWERS

    http://www.mhhe.com/cgi-bin/netgrader.pl 12/12

    The three types of abstraction (data, procedural and iteration) are all instances of the moregeneral concept of information hiding. Schach C7.6 p195

    43. The problem that once a class has been implemented, any change to an existing class directlyaffects all is descendents in the inheritance hierarchy is known as:

    Your response: A. the fragile base class problem

    Correct!

    The affected elements have to be at least recompiled and sometimes recoded. SchachC7.10 p206

    Your Score:

    Correctly answered 6 out of 43 total questions or 14.0% correct.

    Click here to retake quiz.