What is an algorithm?
A set of step-by-step instructions to solve a problem
What shape do we use for a decision (yes/no)?
Diamond.
What is decomposition?
Breaking a big problem into smaller parts.
What does print("Hello") do?
Displays Hello on the screen.
What does an if statement do?
Checks a condition and runs code only if it's true.
Put these steps in order: Bake cake, Mix ingredients, Eat cake, Set timer.
Mix → Set timer → Bake → Eat.
What shape do we use for start/end?
Oval.
What is pattern recognition?
Finding similarities to help solve problems.
Which code asks the user their name?
input("What is your name? ")
What is wrong with this code?
label .start
name = input("Name?")
if name == ""
goto .start
print("Hello ", name)
Missing colon at the end of if statement:
if name == "":
Is this an algorithm? “Make a sandwich.” Explain.
No — it is not detailed enough.
What shape do we use for process (e.g., “Add 1”)?
Rectangle.
What is abstraction?
Ignoring details you don’t need.
Identify the variable and its type:
name = "Sam"
The variable is name.
String variable
What does this loop do?
label .a
ans = input("Say yes: ")
if ans != "yes":
goto .a
print("Good job")
Repeats until user types “yes”.
Give one example of using an algorithm in real life.
Following a recipe, directions, brushing teeth, etc. - detailed step by step instructions provided
A flowchart diamond says “Is number > 10?” What are the two arrows?
Yes and No.
What is algorithmic thinking?
Creating clear, repeatable steps to solve a problem.
Fix the error:
print(Hello)
print("Hello")
Fix the error:
if colour == "Red" or "Blue":
print("Nice colour!")
if colour == "Red" or colour == "Blue":
Fix this algorithm:
Put on shoes
Put on socks
Tie shoes
Put on socks
Put on shoes
Tie shoes
Identify the error: A flowchart has no EXIT/END symbol.
It must end with an oval for END.
Give an example of decomposition when cleaning a room.
Clean desk → pick up clothes → make bed, etc.
What is wrong with this program?
colour = input("Enter colour")
print(colour
Missing closing paranthesis
colour = input("Enter colour")
print(colour)
Write a loop that keeps asking “Type OK” until the user types OK.
label .loop
ans = input("Type OK: ")
if ans != "OK":
goto .loop
print("Thank you")