9781111969752_TB_ch03 - Chapter 3 Understanding Structure...

This preview shows 1 out of 3 pages.

Chapter 3: Understanding Structure TRUE/FALSE 1. Structured programs use spaghetti code logic. ANS: F PTS: 1 REF: 84 2. In a selection structure, you perform an action or task, and then you perform the next action in order. ANS: F PTS: 1 REF: 86 3. Repetition and sequence are alternate names for a loop structure. ANS: F PTS: 1 REF: 88 4. In a structured program, any structure can be nested within another structure. ANS: T PTS: 1 REF: 94 5. A structured program must contain a sequence, selection, and loop structure. ANS: F PTS: 1 REF: 94 6. Because you may stack and nest structures while retaining the overall structure, it might be difficult to determine whether a flowchart as a whole is structured. ANS: T PTS: 1 REF: 96 7. As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input. ANS: T PTS: 1 REF: 100 8. Structured programming is sometimes called goto-less programming. ANS: T PTS: 1 REF: 101 9. No matter how complicated it is, any set of steps can always be reduced to combinations of the two basic structures of sequence and loop. ANS: F PTS: 1 REF: 110 10. The case structure is a variation of the sequence structure and the do loop is a variation of the while loop. ANS: F PTS: 1 REF: 110 MULTIPLE CHOICE 1. Programs that use _____ code logic are unstructured programs that do not follow the rules of structured logic.
Image of page 1

Subscribe to view the full document.

a. case c. spaghetti b. loop d. nested ANS: C PTS: 1 REF: 84 2. With a(n) ____, you perform an action or task, and then you perform the next action, in order. 3. The following pseudocode is an example of a ____ structure. get firstNumber get secondNumber add firstNumber and secondNumber print result 4. The following pseudocode is an example of a ____ structure. if firstNumber is bigger than secondNumber then print firstNumber else print secondNumber 5. Fill in the blank in the following pseudocode: if someCondition is true then do oneProcess ____ do theOtherProcess a. then c. do b. while d. else ANS: D PTS: 1 REF: 87 6. if-else examples can also be called ____ because they contain the action taken when the tested condition is true and the action taken when it is false.
Image of page 2
Image of page 3
You've reached the end of this preview.
  • Fall '15
  • pts, Control flow, 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