COM
9781111969752_TB_ch09

9781111969752_TB_ch09 - Chapter 9 Advanced Modularization...

Info icon This preview shows pages 1–3. Sign up to view the full content.

Chapter 9: Advanced Modularization Techniques TRUE/FALSE 1. You can invoke or call a method from another program or method. ANS: T PTS: 1 REF: 356 2. When methods must share data, you can pass the data into and return the data out of methods. ANS: T PTS: 1 REF: 358 3. A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant. ANS: T PTS: 1 REF: 362 4. A method’s return type is part of its signature. ANS: F PTS: 1 REF: 367 5. A method’s declared return type must match the type of value used in the return statement. ANS: T PTS: 1 REF: 368 6. Methods with identical names that have identical parameter lists but different return types are ambiguous. ANS: T PTS: 1 REF: 385 7. All modern programming languages contain many methods that are predefined. ANS: T PTS: 1 REF: 386 8. In implementation hiding, the calling method needs to understand only the interface to the method that is called and it need not know how the method works internally. ANS: T PTS: 1 REF: 388 9. Most programmers consciously make decisions about cohesiveness for each method they write. ANS: F PTS: 1 REF: 389 10. Programs that use recursion are error-prone but easy to debug. ANS: F PTS: 1 REF: 393 MULTIPLE CHOICE 1. The last statement in a method is a(n) ____. a. begin statement c. exit statement b. return statement d. end statement
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

ANS: B PTS: 1 REF: 356 2. Variables and constants are ____ within, or local to, only the method in which they are declared. a. in scope c. out of scope b. out of bounds d. limited ANS: A PTS: 1 REF: 356 3. When a data item is known to all of a program’s modules, it is a ____data item. 4. A calling method sends a(n) ____ to a called method. 5. A called method accepts the value of an argument passed to it as its ____. 6. A method’s name and parameter list constitute the method’s ____. a. header c. contract b. interface d. signature ANS: D PTS: 1 REF: 359
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '15
  • Method, pts, Subroutine, REF

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern