String handling – AQA GCSE Computer Science lesson (8525)
Pupils learn to use length, position, substring, concatenation and character code conversions in the class's language and AQA pseudo-code.
Lesson 2 of 11 in unit 10.4 Characters, Images, Sound, Strings and Data Structures, taught in Year 10, Spring 2. It answers one big question: How can a program take apart and join up text?
By the end, pupils can use length, position, substring, concatenation and character code conversions in the class's language and AQA pseudo-code.
- The Build (the main task)
- Write a program that inputs a fan's first name and surname and outputs a wristband code made of the first three letters of the surname, the length of the first name and the character code of the first name's first letter. For example, Maya Osei gets Ose477. (6 marks)
- Support version
- Part-filled code with the substring and length lines written; pupils add the character code conversion and the concatenation.
- Challenge
- In AQA pseudo-code, state the value of each of these: (a) SUBSTRING(2, 5, 'Festival') (b) POSITION('Festival', 't') (c) LEN('Festival') + 1 (3 marks) Write a program that inputs the name of a stage and outputs its last character and the character code of that character. (4 marks) Write a program that inputs an act's name and uses a loop to output every character of the name on its own line, followed by its character code. (5 marks)
- Real-world link
- The festival app makes a wristband code from each fan's name.
- Key words
- Concatenation, Substring and Character code, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “The first character of a string is at position 1”; “AQA's SUBSTRING(2, 5, s) gives three characters, ending before position 5”.
- AQA 8525 specification
- 3.2.8 (string handling: length, position, substring, concatenation, character codes, conversions).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils need computers for the main task.
Also sold in the Characters, Images, Sound, Strings and Data Structures unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
Choose your school's Paper 1 language when you buy: C#, Python or VB.NET. You get that language's files: every program, code example, worked answer and programming task is written in it, and lessons with no code are the same in all three. Algorithms are also shown in AQA pseudo-code, as in the exam.
An independent resource written for AQA GCSE Computer Science (8525). It is not endorsed by AQA.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Single-teacher licence: use and adapt it with your own classes
- Your choice of Paper 1 language: C#, Python or VB.NET
More for GCSE Computer Science (AQA)
See allPupils learn to describe 7-bit ASCII and Unicode, use a character table, and explain why Unicode is needed.
Pupils learn to explain how a bitmap represents an image with pixels and colour depth, and convert a simple bitmap to and from binary.
Pupils learn to calculate bitmap file sizes in bits and bytes and explain how image size and colour depth affect file size.
Written for the specifications named. Not endorsed by or affiliated with any exam board.