Exam 4: Repetition Structures

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The first input operation is called the _____, and its purpose is to get the first input value that will be tested by the validation loop.

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

A

The variable used to keep the running total is called a(n) _____.

Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
Verified

A

A(n) _______________ is a special value that marks the end of a sequence of items.

Free
(Short Answer)
4.9/5
(38)
Correct Answer:
Verified

sentinel

The first line in the while loop is referred to as the condition clause.

(True/False)
4.8/5
(36)

A(n) _______________ total is a sum of numbers that accumulates with each iteration of a loop.

(Short Answer)
4.7/5
(38)

Functions can be called from statements in the body of a loop, and loops can be called from the body of a function.

(True/False)
4.7/5
(45)

A better way to repeatedly perform an operation is to write the statements for the task once, and then place the statements in a loop that will repeat the statements as many times as necessary.

(True/False)
4.9/5
(32)

In Python, the variable in the for clause is referred to as the _____ because it is the target of an assignment at the beginning of each loop iteration.

(Multiple Choice)
4.9/5
(34)

The integrity of a program's output is only as good as the integrity of its input. For this reason the program should discard input that is invalid and prompt the user to enter correct data.

(True/False)
4.8/5
(30)

What type of loop structure repeats the code a specific number of times?

(Multiple Choice)
4.9/5
(34)

In Python, an infinite loop usually occurs when the computer accesses the wrong memory address.

(True/False)
4.8/5
(29)

A(n) _______________ validation loop is sometimes called an error trap or an error handler.

(Short Answer)
4.8/5
(43)

A(n) _______________-controlled loop causes a statement or set of statements to repeat as long as a condition is true.

(Short Answer)
4.8/5
(45)

A(n) _______________ loop usually occurs when the programmer forgets to write code inside the loop that makes the test condition false.

(Short Answer)
4.7/5
(34)

What type of loop structure repeats the code based on the value of the Boolean expression?

(Multiple Choice)
4.9/5
(38)

What is the structure that causes a statement or a set of statements to execute repeatedly?

(Multiple Choice)
4.7/5
(35)

The acronym _______________ refers to the fact that the computer cannot tell the difference between good data and bad data.

(Short Answer)
4.8/5
(40)

What is the disadvantage of coding in one long sequence structure?

(Multiple Choice)
4.8/5
(37)

Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1,5):

(True/False)
4.8/5
(24)

What are the values that the variable num contains through the iterations of the following for loop? For num in range(2, 9, 2)

(Multiple Choice)
4.9/5
(36)
Showing 1 - 20 of 34
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)