Filters
Question type

Study Flashcards

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


A) Duplicated code makes the program faster to write.
B) Writing a long sequence of statements is error prone.
C) If parts of the duplicated code have to be corrected, the correction has to be made many times.
D) It does not make use of decision structures.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

_____ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a computation.


A) Input validation
B) Correcting data
C) Data validation
D) Correcting input

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

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


A) Condition-controlled loop
B) Number-controlled loop
C) Count-controlled loop
D) Boolean-controlled loop

Correct Answer

verifed

verified

Reducing duplication of code is one of the advantages of using a loop structure.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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.


A) priming read
B) first input
C) loop set read
D) loop validation

Correct Answer

verifed

verified

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


A) Accumulator
B) Total
C) running total
D) grand total

Correct Answer

verifed

verified

What is not an example of an augmented assignment operator?


A) *=
B) /=
C) -=
D) <=

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) 2, 3, 4, 5, 6, 7, 8, 9
B) 2, 5, 8
C) 2, 4, 6, 8
D) 1, 3, 5, 7, 9

Correct Answer

verifed

verified

Showing 21 - 35 of 35

Related Exams

Show Answer