WorksheetsAP Computer Science Principles Final Project (Unit 6-Loops)
Total questions: 15
Worksheet time: 5mins
What is the definition of a loop in computer science?
A structure, series, or process, the end of which is connected to the beginning
A repetitive portion of an algorithm which repeats a specified number of times or until a given condition is met
A piece of code that continues indefinitely
Circle an aircraft vertically in the air
What is an iteration? (Loops are an example of them)
The repetition of a process or utterance
Repetition of a mathematical or computational procedure as a means of obtaining closer approximations to the solution
A repetitive portion of an algorithm which repeats a specified number of times or until a given condition is met
A loop
What does a for loop do?
Condenses the components of a while loop into one statement
Loop a condition repeatedly without end
Uses a Boolean condition to repeatedly run a block of code
Repeats a segment of code for as long as the program is running
When is a for loop used?
When the number of iterations is unknown
When the number of iterations is known
What is an example of when a for loop would be used?
Checking the grades of all the students in a class
Printing the number of odd numbers from 1 to 1001
Determining how many times a given number can be divided by 2
While you press the accelerator, you do drive
List the components of a for loop
(a)
A for loop is also known as... (AP Pseudocode)
REPEAT n TIMES loops
REPEAT UNTIL loops
What does a while loop do?
Condenses the components of a while loop into one statement
Loop a condition repeatedly without end
Uses a Boolean condition to repeatedly run a block of code
Repeats a segment of code for as long as the program is running
When is a while loop used?
When the number of iterations is unknown
When the number of iterations is known
What is an example of when a while loop would be used?
Checking the grades of all the students in a class
Printing the number of odd numbers from 1 to 1001
Determining how many times a given number can be divided by 2
While you press the accelerator, you do drive
List the components of a while loop
(a)
A while loop is also known as... (AP Pseudocode)
REPEAT n TIMES loops
REPEAT UNTIL loops
What happens when the ending condition of a loop will never evaluate to true?
A Loop-While loop
A Loop-For loop
Inoperative loop
An infinite loop
If the reused code needs to be used multiple times in a row, use a...
Function
Loop
If the reused code needs to be used at some other point later, use a...
Function
Loop
