Term 1 · Computing · Age 13
Algorithms and programming
Term 1: 10 lessons in Computing · Age 13
- Reading and repairing pseudocode: This algorithm should output the larger of two numbers. Choose values for a and b and run it line by line.
- Following a loop: A FOR loop repeats the steps inside it a fixed number of times. The counter i goes up by 1 each pass.
- Predicting what a loop outputs: Good programmers predict the output before running code. Choose your prediction for this loop, then run it to check.
- Designing an algorithm: flowchart and pseudocode: A heater algorithm: input the temperature; if it is below 18 °C, turn the heater on.
- Calling a routine: A procedure is a named group of steps.
- Count-controlled loops in Python: for i in range(start, stop, step) repeats a fixed number of times. The loop stops before it reaches the stop value.
- Data types: Every value has a data type. It decides what you can do with the value: you can add integers, but not a name.
- Arrays and indexes: An array stores a set of related values under one name. Each item has an index, starting at 0. Move the slider to read different items.
- Working with strings: len() counts the characters in a string, including spaces. upper() and lower() change the case. Try three strings.
- Sequence, selection and iteration together: This quiz asks 3 questions in a loop, checks each answer with IF, and keeps a score. Choose which answers are right, then run it.