The answersDownload the PDF
Worksheet

F6.6 The IDE

Robust programs · GCSE · OCR J277 2.5.2, AQA 8525 3.4.4, Edexcel 1CP2 6.1.5 · about 12 min

BugBotLab
NameClassDate

What this lesson is about

Editors, error diagnostics, the run-time environment and the translator, in the cell you use.

Questions 4 marks in all

  1. [1 mark]Which are IDE tools listed by OCR?

    Tick every answer that is true.

    1. AEditors
    2. BError diagnostics
    3. CRun-time environment
    4. DTranslators
  2. [1 mark]How does syntax highlighting help a programmer?

    1. AA missing quote or keyword stands out because the colours change
    2. BIt runs the program faster
    3. CIt fixes errors automatically
    4. DIt translates the code
  3. [1 mark]What does stepping through a program in a debugger do?

    1. ARuns it one line at a time so values can be watched
    2. BDeletes lines with errors
    3. CCompiles it to machine code
    4. DSaves a copy
  4. [1 mark]Which IDE feature reports the line and type of an error?

    1. AError diagnostics
    2. BCode completion
    3. CFolding
    4. DLine numbers only

The task: use the diagnostics

This program should flash the LED three times, beeping each time, and then print flashed 3 times. It has a syntax error, a runtime error and a logic error. Use the squiggle, the error message and Debug to find and fix all three.

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

flashes = 0
for i in range(3)
    led("blue")
    tone(660, 0.1)
    wait(0.2)
    led("off")
    flashes = 1
print("flashed", flashs, "times")

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

QR code
Do it on the robot
www.bugbotlab.com/learn/f6-6-the-ide/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Download a program from a cell as a .py file and open it in another editor. Which features are missing?
  2. Use the saved versions button to keep a working copy of a program, break it on purpose, then go back.
  3. List the IDE features you used in this lesson under OCR's four headings: editors, error diagnostics, run-time environment and translators.