Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Computer Science 2: Control Structures

Total questions: 11

Worksheet time: 12mins

Name
Class
Date
1.

What are the three main programming structures?

a)

Sequence, selection, iteration

b)

Structured, object-oriented, procedural

c)

Java, Python, Visual Basic

d)

Machine, assembly, high-level

2.
Which control structure will execute an instruction only after the computer evaluates conditions to determine if a certain condition exists?
a)
Selection
b)
Loop
c)
Functional
d)
Sequence
3.
Which type of programming structure requires each instruction to be performed in order, with no possibility of skipping an action or branching off to another action?
a)
Loop
b)
Sequence
c)
Selection
d)
Iteration
4.

In programming, what is iteration?

a)

The repetition of steps within a program

b)

The order in which instructions are carried out

c)

A decision point in a program

d)

A terminating statement

5.
Jackson has written a section of code in his program that instructs a character to move forward unless it encounters an obstacle, such as a rock. If the character encounters an obstacle, then it should change direction before moving forward again. If it does not encounter an obstacle, it should continue moving forward. Which type of control structure has Jackson written?
a)
Selection
b)
Loop
c)
Functional
d)
Sequence
6.

Identify the control structure involved to this question.

A grocery store manager wants a program that allows the clerk to enter original price of an item and discount rate. The program then should display both the original and discounted price.

a)

Selection

b)

Sequence

c)

Iteration

d)

single-alternative ifs

7.

A benefit of using flowcharts is:

a)

They help you program faster

b)

They write the program for you

c)

They are easier

d)

They help you to visually plan a program

8.
What type of flowchart is shown here?
a)
selection
b)
iteration / loop
c)
sequence
9.
What type of flowchart is shown here?
a)
selection
b)
iteration / loop
c)
sequence
10.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
11.
What is the Output if the temperature is:
19
a)
Below Freezing
b)
Above Freezing