ExamYard Lectures

Strings, procedures and functions

IGCSE Computer Science 0478 · Chapter 8.1, Strings and subroutines · 6-minute lecture

The teaching part (1 min) is free to watch. A free account opens the whole lecture: 9 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.

What this lecture covers

  1. Cutting words, building blocks
  2. Positions in a string
  3. String routines
Read the transcript of the teaching part

Last time

Before we start: last time, in Databases and SQL, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.

Cutting words, building blocks

Programs handle text all day: usernames, messages, passwords. Library routines cut words, measure them and change their case. And once a task works, we wrap it in a named block that we can use again and again. Those blocks are procedures and functions.

Positions in a string

In Cambridge pseudocode, the first character of a string is at position one. Here is the word Computer. C is position one, o is two, and so on, up to r at position eight. So its length is eight.

String routines

LENGTH gives the number of characters in a string. UCASE changes every letter to upper case, and LCASE to lower case. SUBSTRING takes part of a string: the start position, and how many characters. The ampersand joins two strings together. This is called concatenation.

Chapter 8.1: Strings and subroutines

Also for IGCSE Computer Science 0478

Which topics come up most in IGCSE Computer Science 0478 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.

The topical past-paper books: Paper 1, Paper 2.