Font size
WorksheetsUnit 5
Total questions: 56
Worksheet time: 46mins
What is MicroPython?
A new type of Micro:bit hardware
A simplified version of Python specifically for the Micro:bit
A programming language used only for industrial robots
A web browser
What is the term for the rules of a programming language?
Logic
Cast
Syntax
Algorithm
The light sensor on the Micro:bit returns values in what range?
0 - 100
0 - 1024
0 - 255
1 - 10
Which command is used to read the light level?
What is the primary purpose of a "For" loop?
To repeat code forever.
To repeat code for a specific number of times
To run code only when Button A is pressed
To delete data in an array
What does "Cast" mean in MicroPython programming?
To copy a block of code
To delete a variable
To change the data type of a variable
To connect via Bluetooth
In the array images = [Image.HAPPY, Image.SAD, Image.ANGRY], at which index is Image.HAPPY located?
1
0
-1
2
Which tool helps track variable values to find errors in a program?
Test plan
Array
Trace table
Flowchart
When testing a program for age input (1 to 100), what is the value "100" called?
Normal data
Invalid data
Extreme data
Random data
Why is while True: used in most Micro:bit programs?
To make the program run faster
To save battery life
To continuously check and respond to events (button presses, sensors)
To save memory
Write a line of code to declare an array named list_numbers containing: 5, 10, 15, 20.
(a)
Look at the following code:
for i in range(1, 4):
display.show(i)
sleep(500)
Which numbers will the program display on the LED screen?
(a)
Why must we use the str(number) command when we want the Micro:bit to "speak" a number using the speech library?
Write pseudocode or MicroPython code for: When Button A is pressed, show a heart image (Image.HEART); when Button B is pressed, clear the screen.
In a test plan for an exam score input (range 0 to 10), which of the following best describes the difference between Normal data and Invalid data?
Normal data is 5 (within range); Invalid data is 10 (at the boundary)
Normal data is 7 (within range); Invalid data is "Ten" or -5 (wrong type or out of range)
Normal data is 0 (at the boundary); Invalid data is 11 (just outside range)
Normal data is any number; Invalid data is only text
SET counter TO 0
FOR i FROM 1 TO 5 STEP 1:
SET counter TO i * 2
END FOR
DISPLAY counter
5
8
10
2
SET icons TO [Image.HAPPY, Image.SAD, Image.GHOST, Image.SKULL]
SET index TO 2
DISPLAY icons[index]
Image.HAPPY
Image.SAD
Image.GHOST
Image.SKULL
SET light_level TO 100
IF light_level < 50 THEN:
DISPLAY "DARK"
ELSE IF light_level > 150 THEN:
DISPLAY "BRIGHT"
ELSE:
DISPLAY "OK"
END IF
DARK
BRIGHT
OK
Error
SET total TO 0
FOR number FROM 1 TO 3:
SET total TO total + number
END FOR
SET output TO CAST(total AS STRING)
DISPLAY "Result: " + output
Result: 3
Result: 6
Result: 123
Error
FOR count FROM 3 TO 1 STEP -1:
DISPLAY count
SLEEP 500ms
END FOR
DISPLAY "GO!"
1, 2, 3, GO!
3, 2, 1, GO!
3, 2, GO!
3, 1, GO!
Device that can be programmed using block or text-based programming languages.
Physical computing device
Microprocessor
Count-controlled loop
Platform
Written lines of code using a specific programming language, e.g. Python.
Offline programming
Block-based program
Pseudocode
Text-based programming
Device that has one circuit but the input, process and output functions of a computer.
Transistor
Motherboard
Microprocessor
Server
Instructions that tell a computer system how to complete a task.
Statement
Program
Class
Event
Individual code blocks connected together to create a program.
Block-based program
Pseudocode
Count-controlled loop
Text-based programming
Hardware and operating system that runs an application.
Array
Desktop
Platform
Database
Detects a change in direction of a device.
Accelerometer
Hygrometer (Measures humidity)
Multimeter (Measures electricity)
Magnetometer (Measures magnetic fields/compass direction)
Device that can be programmed using block or text-based programming languages.
(a)
Pins at the bottom of the micro:bit that allow additional inputs and outputs to be added through crocodile clips.
USB Port
Battery Connector
Reset Button
General-purpose input output (GPIO)
Cable for creating a temporary electrical connection between devices.
USB Cable
Power Lead
Crocodile clip
Ethernet Cable
Error in program code that stops the program from running.
Syntax Error
Feature
Algorithm
Logic
Textual representation of an algorithm.
Software
Hardware
Pseudocode
Compiler
Completes a check to see whether set criteria is either True or False.
Variable
Loop
Selection (Boolean check)
Conditional statement
Document that details the tests to be carried out when a program is complete and whether or not they are successful.
User Manual
Test Plan
Source Code
Flowchart
(a) is the data of the correct type that should be accepted by a program.
(a) is defined as acceptable input but at the ends of the possible input range.
" (a) is defined as data that should be rejected by a program."
"A (a) is a randomly generated number in a program that can be set within a range."
A (a) is a named memory location that can store a value."
"An (a) is a data structure in a program that can store more than one item of data of the same data type under a single identifier; data items can be changed."
"The way a variable or array is named in programming is called a (a) ."
" (a) is a naming style where all letters are lowercase, and from the second word the first letter is capitalised."
" (a) is a naming style where all letters are lowercase, and spaces are replaced with underscores ( _ )."
"A (a) is defined as a whole number."
"A (a) is a piece of information that represents part of the data that makes up a person, place or thing."
"A (a) is a sequence of characters that can be text, numbers or symbols; quotation marks around the characters are used to define it."
"A numerical reference for a location of a piece of data stored in an array is called an (a) ."
"The (a) is the Python or MicroPython loop used for a count-controlled loop."
"A(n) (a) is a variable that stores the number of times an iteration has iterated."
"A(n) (a) is a set of step-by-step instructions to solve a particular problem."
"A(n) (a) is a sub-program that can exist as part of a bigger program."
" (a) is the classification applied to a data item specifying which type of data that item represents (such as currency, text, or number)."
" (a) is a set of rules that must be met."
" (a) refers to one programming construct, such as selection, occurring inside another construct, such as a count-controlled loop."
"A(n) (a) is an initial product created for testing and reviewing, before a final product is released."
" (a) is a choice added to a program using if... elif... else, where the next instruction is decided by the outcome of a condition."
