6.2 (Algorithms) - SUMMARY
6.2 (Algorithms) - SUMMARY
K EY V OCABULARY
Modelling a scenario The act of describing a real-life situation using data and rules
Sensor A device that is able to gather data from its surroundings to respond to
or record.
Software Software is a set of instructions that tell a computer what to do.
Hardware Parts of a computer that you can touch; the physical components of a
device. Hardware lets you input and output data, save and read data
from storage devices and process or manipulate data.
Acce lerometer A sensor to detect movement.
Systems software Software that manages and oversees how the computer system (which
may include hardware and other software) runs, e.g. the operating
system, antiv irus, system settings.
Operating system The systems software that manages hardware, software and resources
on a device.
Applications software Software used for general or specific tasks.
Simulator Software to simulate a real-world application.
Algorithm A sequence of steps or instructions to solve a problem.
Flashing the program Downloading the MicroPython program file to the micro:bit to run.
Library A list of all programming commands that are available under the library
name.
String A data type for storing combinations of letters, numbers or any
characters on the keyboard.
Integer Whole number.
Decompose Break down into smaller parts.
Gesture A specific movement on the micro:bit.
Test plan A structured (step-by-step) approach to testing whether your solution
works as expected; a document that describes the areas of a program to
be tested – includes details of the tests to be applied to each area of
the program, including test data and expected results.
Warmup
Group Activity Extension
Make a list of computing Make a list of different types
devices you could find in a of sensors and what they are
modern house. used to sense.
e.g. smart TV e.g. voice sensor – detects
when you say "Hi Siri"
laptop, smart phone, vacuum
cleaner, Roomba vacuum
cleaner, tablet, TV with Alexa
electrical piano, desktop
computer, Air conditioning
unit, smart watch, gaming
console, printer, camera,
smart speaker, blender, guitar
tuner, phone
Intro to Micro:bits
python.microbit.org
Answer:
Now modify your flowchart to show this code:
Answer:
The "while True:" loop means instead of stopping it goes back
to the start. Both of the below flowcharts are good.
Look at this flowchart:
Ass ignment
name = "JC"
print(name)
How do you know what that it will print "JC"? Because "JC"
was stored in the variable name.
Assignment is the act of saving data into a variable.
Selection
When the flowchart has to choose between "Yes" and "No"
this means the algorithm is making a decision. This is called
selection.
while True:
if display.read_light_level() > 10:
music.play(music.DADADADUM)
The test plan in the worksheet above has two blank columns,
which you fill in when you run the code. This is how you spot
mistakes – see below; the expected outcome did not match
what happened.
1. What are the 5 steps of planning a project (a "project plan")?
plan, design, create, test, evaluate
2. What does "decompose" mean?
break down into smaller parts
3. Why do we break the program down into smaller parts when planning?
To make it easier to solve the problem. To make the task more
manageable.
4. What is the role of a flowchart when designing
Flowcharts help us plan what will happen after each step in the algorithm,
without having to fix mistakes in the code.
5. Why is it essential to have a test plan when testing?
Test plans are needed to thoroughly check our code is working in the way
we want it to.
6. What should a test plan include?
Key information in a test plan is:
Input/Test Data
Expected Result
Actual Result
Pass/Fail
7. How do you review a test plan to ensure it is effective?
Check the test plan covers all paths in the algorithm, and also normal and
extreme values.
For example, if you buying an old laptop, you would have a list
of things you want to check before paying money.
Test Input / Test Data Expected Actual Pass /
ID Result Result Fail
1 Typing on the letters appear on
keyboard the screen
2 Opening the screen laptop turns on
3 Clicking the mouse mouse is clicked
4 Playing music there is sound
from the speakers
This is the plan. You would fill in the Actual Result and
whether it was a Pass/Fail when you do the checks.