wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming Basics: Statements & Functions

Total questions: 25

Worksheet time: 8mins

Name
Class
Date
1.

Which loop is used for a specified number of times?

a)

open

b)

nested

c)

For

d)

while

2.

A function is useful because you write it once and call it as often as needed.

a)

True

b)

False

3.

Which of the following are types of conditional statements?

a)

If and If/Else

b)

while and For

c)

For and If/Else

d)

If/Else and while

4.

Which of the following is NOT a control structure used in coding?

a)

Repetition

b)

Selection

c)

Sequential

d)

Differential

5.

What type of control structure is a conditional statement?

a)

Repetition

b)

Selection

c)

Sequential

d)

Differential

6.

How does the computer use a selection control structure to decide which path to follow?

a)

By determining which requirements have been met”

b)

By repeating the code until a requirement is met

c)

Randomly

d)

By guessing which requirements work best

7.

A repetition control structure executes code one time only.

a)

True

b)

False

8.

How is a sequential control structure read?

a)

Each line in order, from top to bottom

b)

Each line in random order

c)

In a circular, repetitive order

d)

Only reads lines marked as significant; other lines are ignored

9.

A command is

a)

a one-word instruction that has been assigned meaning

b)

a word that is open for interpretation

c)

an order you give to the computer verbally.

d)

a sentence the provides information

10.

Which of the following describes the Define phase of the programming process?

a)

Create a plan using algorithms and control structures

b)

Write the code

c)

Identify and correct any errors

d)

Determine the problem

11.

What type of control structure is the default method of the computer reading code?

a)

Selection

b)

Sequential

c)

Repetition

d)

Differential

12.

A ________________ control structure is used to reduce the number of lines of code for an action that will need to be repeated many times.

a)

Repetition

b)

Differential

c)

Selection

d)

Sequential

13.

Which type of loop only runs while a condition is true?

a)

open

b)

nested

c)

For

d)

while

14.

A statement is

a)

a sentence

b)

all other elements of a command

c)

a one-word instruction that has assigned meaning

d)

a control structure

15.

A nested loop is

a)

two loops run one after the other

b)

two loops with no relation to one another

c)

a loop within a loop

d)

a loop inside any other type of control structure

16.

Which of the following describes the Test phase of the programming process?

a)

Create a plan using algorithms and control structures.

b)

Determine the problem

c)

Write the code

d)

Identify and correct any errors

17.

A function

a)

is a selection control structure

b)

repeats a sequence of commands

c)

performs a specific task when called.

d)

is one line of code

18.

An If/Else statement should be used when you want one of two sections of code to be executed.

a)

True

b)

False

19.

Which of the following are reasons control structures are used?

a)

To make code clear

b)

To make code easy for others to follow

c)

To save time

d)

All of the above

20.

Which of the following describes the Design phase of the programming process?

a)

Determine the problem

b)

Write the code

c)

Create a plan using algorithms and control structures

d)

Identify and correct any errors

21.

Which of the following is NOT one of the five steps of the programming process?

a)

Design

b)

Define

c)

Code

d)

Interview

22.

A loop

a)

performs a specific task when called

b)

is one line of code

c)

is a selection control structure

d)

repeats a sequence of commands

23.

A selection control structure is used to choose between two or more alternative paths.

a)

True

b)

False

24.

Which of the following is NOT a type of loop?

a)

nested

b)

while

c)

For

d)

open

25.

A conditional statement is a statement

a)

is only executed when the code has been run more than one time

b)

that is only used when there are multiple conditions that must be met

c)

that only appears when called and is then executed

d)

that allows the computer to choose between different paths in a program