Chapter 4 Loops

Card Set Information

Author:
randycapped
ID:
246917
Filename:
Chapter 4 Loops
Updated:
2013-11-14 15:56:36
Tags:
programming loops
Folders:

Description:
Hruby
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user randycapped on FreezingBlue Flashcards. What would you like to do?


  1. A _______ loop executes statements repeatedly while the condition is true.
    while
  2. The loop-continuation-condition must always appear within the __________.
    parentheses
  3. (count < 100) is an example of a ______ ______ ______.
    loop continuation condition.
  4. In order for the loop-continuation-condition to eventually terminate it will have to eventually become _______.
    false
  5. A _______ loop is the same as a while loop except it executes the loop body first and then checks the loop continuation condition.
    do-while.
  6. A ________ loop has a concise syntax for writing loops.
    for
  7. Three types of repetition statements (loops) are:
    • while
    • do-while
    • for
  8. The part of the loop that contains the statements to be repeated is called the _____ ______
    loop body
  9. A one time execution of a loop body is referred to as an _______ of the loop.
    iteration
  10. An ______ loop is a loop that executes infinitely.
    infinite
  11. The while loop checks the ______ _____ ______ first. If the condition is true, the loop body is _________.  If it is false, the loop ________.
    • loop-continuation-condition
    • executed
    • terminates
  12. A _______ value is a special value that signifies the end of a loop.
    sentinel
  13. The ____ loop generally is used to execute a loop body a predictable number of times; this number is not determined by the loop body.
    for
  14. The while and for loop are called the _____ loops because the continuation condition is checked before the loop body is executed.
    pretest
  15. The do-while loop is called a _________ loop because the continuation condition is checked after the loop body is executed.
    postest
  16. Looping makes computer programming ______ and ________.
    • efficient
    • worthwhile
  17. A loop is a structure that ______ ______ while some condition continues.
    repeats actions.
  18. A _______ loop executes a predetermined number of times.
    definite
  19. Loop control variables are altered by ________ and _______.
    • incrementing
    • decrementing
  20. A _______ ______ loop is a program that counts loop repetitions.
    counter - controlled
  21. True or false. An indefinite loop and infinite loop are the same.
    False.
  22. A for loop automatically does these 3 things:
    • Initializes
    • Evaluates
    • Increments
  23. An ________ is a variable that gathers values.
    accumulator
  24. These 3 steps must occur in every loop:
    • Initialize loop control variable
    • Compare variable to some value
    • Alter the variable that controls the loop
  25. Loops within loops are called ______ loops.
    nested
  26. Nested loops maintain two individual ______ _______ ________.
    loop control variables
  27. Loops are used to ensure data is ______ by prompting the ______.
    • valid
    • user
  28. A _______ loop is used with definite loops when number of _______ is known.
    • for
    • iterations
  29. 4 common mistakes made by programmers:
    • Neglecting to initialize loop control variable
    • Neglecting to alter loop control variable
    • Using wrong comparison with loop control variable
    • Including statements inside the loop that belong outside the loop.

What would you like to do?

Home > Flashcards > Print Preview