The answersDownload the PDF
Worksheet

F13.3 Pseudocode in the exam

Exam preparation · GCSE · about 15 min

BugBotLab
NameClassDate

What this lesson is about

Reading and writing exam pseudocode and flowcharts, and translating both ways.

Questions 5 marks in all

  1. [1 mark]How many times does FOR i = 1 TO 5 run?

    1. A5
    2. B4
    3. C6
    4. DIt depends on the board
  2. [1 mark]Which pseudocode keyword prints something?

  3. [1 mark]In a flowchart, what does a diamond mean?

    1. AA decision
    2. BA process
    3. CInput or output
    4. DThe start
  4. [1 mark]What does this program print?

    for i in range(1, 4):
        print(i * i)
  5. [1 mark]You are asked to write an algorithm. What may you use?

    1. APseudocode or a real language, as long as it is clear
    2. BOnly your board's reference language
    3. COnly Python
    4. DOnly a flowchart

The task: pseudocode into Python

Turn the pseudocode in the comment into a working program. It asks for a number of steps, drives that many 10 cm steps while counting the total distance, and prints the total. input() is answered for you with 4.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# steps = USERINPUT
# total = 0
# FOR i = 1 TO steps
#     MOVE FORWARD 10
#     total = total + 10
#     OUTPUT "step " + i + ": " + total
# NEXT i
# OUTPUT "total: " + total

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f13-3-pseudocode-in-the-exam/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Rewrite the same algorithm as a WHILE loop in pseudocode, then in Python.
  2. Write the pseudocode for a program that finds the largest of three numbers.
  3. Draw the flowchart for the task above.