WorksheetsProgramming Basics: Statements & Functions
Total questions: 25
Worksheet time: 8mins
Which loop is used for a specified number of times?
open
nested
For
while
A function is useful because you write it once and call it as often as needed.
True
False
Which of the following are types of conditional statements?
If and If/Else
while and For
For and If/Else
If/Else and while
Which of the following is NOT a control structure used in coding?
Repetition
Selection
Sequential
Differential
What type of control structure is a conditional statement?
Repetition
Selection
Sequential
Differential
How does the computer use a selection control structure to decide which path to follow?
By determining which requirements have been met”
By repeating the code until a requirement is met
Randomly
By guessing which requirements work best
A repetition control structure executes code one time only.
True
False
How is a sequential control structure read?
Each line in order, from top to bottom
Each line in random order
In a circular, repetitive order
Only reads lines marked as significant; other lines are ignored
A command is
a one-word instruction that has been assigned meaning
a word that is open for interpretation
an order you give to the computer verbally.
a sentence the provides information
Which of the following describes the Define phase of the programming process?
Create a plan using algorithms and control structures
Write the code
Identify and correct any errors
Determine the problem
What type of control structure is the default method of the computer reading code?
Selection
Sequential
Repetition
Differential
A ________________ control structure is used to reduce the number of lines of code for an action that will need to be repeated many times.
Repetition
Differential
Selection
Sequential
Which type of loop only runs while a condition is true?
open
nested
For
while
A statement is
a sentence
all other elements of a command
a one-word instruction that has assigned meaning
a control structure
A nested loop is
two loops run one after the other
two loops with no relation to one another
a loop within a loop
a loop inside any other type of control structure
Which of the following describes the Test phase of the programming process?
Create a plan using algorithms and control structures.
Determine the problem
Write the code
Identify and correct any errors
A function
is a selection control structure
repeats a sequence of commands
performs a specific task when called.
is one line of code
An If/Else statement should be used when you want one of two sections of code to be executed.
True
False
Which of the following are reasons control structures are used?
To make code clear
To make code easy for others to follow
To save time
All of the above
Which of the following describes the Design phase of the programming process?
Determine the problem
Write the code
Create a plan using algorithms and control structures
Identify and correct any errors
Which of the following is NOT one of the five steps of the programming process?
Design
Define
Code
Interview
A loop
performs a specific task when called
is one line of code
is a selection control structure
repeats a sequence of commands
A selection control structure is used to choose between two or more alternative paths.
True
False
Which of the following is NOT a type of loop?
nested
while
For
open
A conditional statement is a statement
is only executed when the code has been run more than one time
that is only used when there are multiple conditions that must be met
that only appears when called and is then executed
that allows the computer to choose between different paths in a program
