Python Unit 5

  1. The structure that allows you to write one set of instructions that operates on multiple, separate sets of data is the __________.




    C. loop
  2. The loop that frequently appears in a program's mainline logic _______.




    A. works correctly based on the same logic as other loops
  3. Which of the following is not a step that must occur with every correctly working loop?




    C. Set the loop control value equal to a sentinel during each iteration
  4. The statements executed within a loop are known collectively as the ___________.




    A. loop body
  5. A counter keeps track of _______________.




    C. the number of times an event has occurred
  6. Adding 1 to a variable is also called ______________ it.




    C. incrementing
  7. Which of the following is a definite loop?




    B. a loop that executes 1,000 times
  8. Which of the following is an indefinite loop?




    B. a loop that follows a prompt that asks a user how many repetitions to make and uses the value to control the loop
  9. When two loop are nested, the loop that is contained by the other is the ___________ loop.




    B. inner
  10. When the loops are nested, ___________.




    D. none of the above
  11. Most programmers use a for loop ____________.




    C. when they know the exact number of times a loop will repeat
  12. A report that lists only totals, with no details about individual records, is a(n) __________ report.




    A. summary
  13. Typically, the value added to a counter variable is _________.




    D. 1
  14. Typically, the value added to an accumulator variable is ___________.




    C. different in each iteration
  15. After an accumulator or counter variable is displayed at the end of a program, it is best to ____________.




    D. none of the above
  16. When you ___________, you make sure data items are the correct type and fall within the correct range.




    D. validate data
  17. Overriding a user's entered value by setting it to a predetermined value is known as __________.




    D. forcing
  18. To ensure that a user's entry is the correct data type, frequently you _______________.




    B. use a method built into the programming language
  19. A variable might hold an incorrect value even when it is ____________.




    D. all of the above
  20. A do-while loop ____________.




    B. can be replaced by a sequence and a while loop
Author
jdavis123
ID
357537
Card Set
Python Unit 5
Description
Updated