Computer Science Essentials, Unit 4, Lesson 1 of 5

Completing programs

GCSE Computer Science, Onscreen programming, 35 minutes

Sign in

How an onscreen programming question works, reading a partly written program before you add to it, finishing a subroutine, adding a parameter, calling subroutines from a main program and filling numbered gaps.

What you will learn

  • Read a partly written program and say what each part does
  • Finish a function so it returns the right value
  • Replace a fixed value with a parameter
  • Complete a main program that calls given subroutines
  • Fill numbered gaps without breaking the lines around them

How these questions work

On an onscreen paper you are not given an empty page.

You are given a program that is partly written, and the question tells you what to do to it: complete it, amend it, fix it or extend it. The questions here work the same way.

  • The editor opens on the partly written program. Change only what the task asks for.
  • Your program runs against tests, shown with the question. A call test checks what one function returns; an input test types lines into your program and checks exactly what it prints.
  • Your mark is your share of the tests passed, so a program that does part of the job earns part of the marks.

The program in the editor is the question. Read all of it before you type anything.

The rest of this lesson and its 9 practice questions are locked.

In this lesson

  1. How these questions work
  2. Read before you write
  3. Subroutines, parameters and return values
  4. Main programs and libraries
  5. Try it: Finish a function

9 practice questions, marked as you go; about 35 minutes in all.

Key terms

Complete, Amend, Fix, Extend, Tests, Subroutine, Function, Procedure, Parameters, Arguments

In this unit: Onscreen programming

Partly written Python programs to complete, amend, fix and extend, checked by running them against tests: subroutines, 2D lists, records from files, validation, strings and longer tasks in parts.

All of Onscreen programming