NEW
Font size
Worksheets7th - Unit 4 Lesson 2 Test
Total questions: 20
Worksheet time: 10mins
What are the three main parts of an algorithm?
Input, Output, and Storage
Sequencing, Selection, and Iteration
Numbers, Text, and Images
Variables, Lists, and Arrays
What does 'sequencing' mean in an algorithm?
Repeating a step over and over
Asking a question to make a decision
The specific order of steps needed to reach a goal
Fixing mistakes in the code
If you want a computer to do a math problem, which part of the algorithm comes first?
Display the answer to the user
Define the variables
Perform the math function
Assign the answer to a variable
Which part of an algorithm uses 'if' statements to ask questions and make decisions?
Selection
Sequencing
Iteration
Translation
What is the main purpose of 'iteration' in coding?
To define a variable name
To repeat steps until a specific condition is met
To stop the code immediately
To list steps in a specific order
Which of the following is an example of iteration?
Defining a number as 5
A business sending a thank you email to a single person
Doing the same task over and over
Checking if a customer spent $500
What is a 'variable' in coding?
A set of data used to store specific information
A repeated action
A type of computer error
The speed of the internet
Which type of variable would you use to store a person's email address?
Boolean
Integer
Text
Array
What is a 'Boolean' variable most like?
A calculator
A light switch (On/Off)
A dictionary
A grocery list
If you need to store a player’s score or age, which variable type should you use?
Text
Boolean
Integer
String
What do 'operators' do in an algorithm?
They delete old files
They allow variables to interact (like adding or comparing them)
They turn the computer on and off
They create pictures for the user
Which symbol is used to assign data to a variable?
+
==
=
>
Which operator would you use to check if two variables are exactly the same?
Greater than (>)
Less than (<)
Not equal to (!=)
Equal to (==)
What happens if you use the code variable++?
It subtracts 1 from the variable
It adds 1 to the variable
It deletes the variable
It multiplies the variable by 2
What is the smallest measurement of machine data?
A byte
A bit
An integer
A list
How many bits make up one byte?
2
4
8
10
How is the letter 'A' stored in a computer?
As a picture of the letter A
As a sound file
As a binary number made of 0s and 1s
As a text variable only
What is the difference between a variable and a list (array)?
A variable holds numbers, but a list only holds text
A variable holds one piece of data, but a list can store many pieces of data
A list is smaller than a variable
Variables are not used in algorithms
If you wanted to store a list of product prices for a store, what would be the best tool?
A Boolean
A single Integer
An Array (List)
A Text string
In the text, sending a newsletter only to customers who spent over $500 is an example of what?
Sequencing
Selection
Iteration
Machine Data
