wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP Computer Science Principles Final Project (Unit 6-Loops)

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

What is the definition of a loop in computer science?

a)

A structure, series, or process, the end of which is connected to the beginning

b)

A repetitive portion of an algorithm which repeats a specified number of times or until a given condition is met

c)

A piece of code that continues indefinitely

d)

Circle an aircraft vertically in the air

2.

What is an iteration? (Loops are an example of them)

a)

The repetition of a process or utterance

b)

Repetition of a mathematical or computational procedure as a means of obtaining closer approximations to the solution

c)

A repetitive portion of an algorithm which repeats a specified number of times or until a given condition is met

d)

A loop

3.

What does a for loop do?

a)

Condenses the components of a while loop into one statement

b)

Loop a condition repeatedly without end

c)

Uses a Boolean condition to repeatedly run a block of code

d)

Repeats a segment of code for as long as the program is running

4.

When is a for loop used?

a)

When the number of iterations is unknown

b)

When the number of iterations is known

5.

What is an example of when a for loop would be used?

a)

Checking the grades of all the students in a class

b)

Printing the number of odd numbers from 1 to 1001

c)

Determining how many times a given number can be divided by 2

d)

While you press the accelerator, you do drive

6.

List the components of a for loop

(a)  

7.

A for loop is also known as... (AP Pseudocode)

a)

REPEAT n TIMES loops

b)

REPEAT UNTIL loops

8.

What does a while loop do?

a)

Condenses the components of a while loop into one statement

b)

Loop a condition repeatedly without end

c)

Uses a Boolean condition to repeatedly run a block of code

d)

Repeats a segment of code for as long as the program is running

9.

When is a while loop used?

a)

When the number of iterations is unknown

b)

When the number of iterations is known

10.

What is an example of when a while loop would be used?

a)

Checking the grades of all the students in a class

b)

Printing the number of odd numbers from 1 to 1001

c)

Determining how many times a given number can be divided by 2

d)

While you press the accelerator, you do drive

11.

List the components of a while loop

(a)  

12.

A while loop is also known as... (AP Pseudocode)

a)

REPEAT n TIMES loops

b)

REPEAT UNTIL loops

13.

What happens when the ending condition of a loop will never evaluate to true?

a)

A Loop-While loop

b)

A Loop-For loop

c)

Inoperative loop

d)

An infinite loop

14.

If the reused code needs to be used multiple times in a row, use a...

a)

Function

b)

Loop

15.

If the reused code needs to be used at some other point later, use a...

a)

Function

b)

Loop