9781111969752_TB_ch05 - Chapter 5 Looping TRUE\/FALSE 1 The loop control variable is initialized after entering the loop ANS F PTS 1 REF 171 2 In some

9781111969752_TB_ch05 - Chapter 5 Looping TRUE/FALSE 1 The...

This preview shows page 1 - 3 out of 8 pages.

Chapter 5: Looping TRUE/FALSE 1. The loop control variable is initialized after entering the loop. ANS: F PTS: 1 REF: 171 2. In some cases, a loop control variable does not have to be initialized. ANS: F PTS: 1 REF: 171 3. An indefinite loop is a loop that never stops. ANS: F PTS: 1 REF: 173 4. You can either increment or decrement the loop control variable. ANS: T PTS: 1 REF: 173 5. When one loop appears inside another is is called an indented loop. ANS: F PTS: 1 REF: 177 6. Forgetting to initialize and alter the loop control variable is a common mistake that programmers sometimes make. ANS: T PTS: 1 REF: 183 7. Every high-level computer programming language contains a while statement. ANS: T PTS: 1 REF: 192 8. Both the while loop and the for loop are examples of pretest loops. ANS: T PTS: 1 REF: 193 9. The safest action is to assign the value 1 to accumulators before using them. ANS: F PTS: 1 REF: 197 10.It is the programmer’s responsibility to initialize all variables that must start with a specific value. ANS: TPTS:1REF:198a.compare the loop control variable to a constant valueb.initialize the loop control variablec.increment the loop control variabled.execute the body of the loop MULTIPLE CHOICE 1. The first step in a while loop is typically to ____.
Image of page 1
ANS: BPTS:1REF:171 2. Once your logic enters the body of a structured loop, ____. a. the entire loop must execute b. the loop can be terminated with a break statement c. the loop will execute indefinitely d. a decision statement will be evaluated ANS: A PTS: 1 REF: 171-172 3.The last step in a whileloop is usually to ____. 4.A(n) ____ loop executes a predetermined number of times. 5.Many loop control variable values are altered by ____, or adding to them. 6.A(n) ____ is any numeric variable you use to count the number of times an event has occurred. a.accumulatorc.indexb.keyd.counterANS: DPTS:1REF:173
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 8 pages?

  • Fall '15
  • loop, loop control, c. posttest loop, c. Nested loop

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors