Relational and Boolean operators in conditions – AQA GCSE Computer Science lesson (8525)
Pupils learn to use relational operators and NOT, AND and OR in conditions, in the class's language and AQA pseudo-code.
Lesson 4 of 12 in unit 10.2 Memory, Storage and Selection, taught in Year 10, Autumn 2. It answers one big question: How can one IF statement test more than one thing?
By the end, pupils can use relational operators and NOT, AND and OR in conditions, in the class's language and AQA pseudo-code.
- The Build (the main task)
- Write a program that inputs a visitor's age and whether they are a member (yes or no), and outputs Discount if they are under 16 or a member, otherwise Full price. Use relational operators and a Boolean operator in one condition. (4 marks) Rewrite the condition from your program in AQA pseudo-code. (2 marks)
- Support version
- Condition cards to order into the IF line, with the language's and the pseudo-code symbols side by side.
- Challenge
- Write one condition that is True only for ages 13 to 17 inclusive: first in the class's language, then in AQA pseudo-code. Then state the four ages you would test it with. (3 marks) Write a program that inputs a day number from 1 (Monday) to 7 (Sunday) and outputs Weekend for 6 or 7, otherwise Weekday. Use one condition with OR. (4 marks) Under-16s swim free at weekends (day 6 or 7); everyone else pays £5. Write a program that inputs a visitor's age and the day number and outputs Free or £5. (6 marks)
- Real-world link
- The kiosk gives a discount to children or members.
- Key words
- Relational operator, Boolean operator and Combine, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “age > 13 includes 13”; “letter == 'A' or 'B' checks both letters”.
- AQA 8525 specification
- 3.2.4 (relational operations); 3.2.5 (boolean operations: NOT, AND, OR).
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 Memory, Storage and Selection 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 explain what main memory is, why the CPU needs it and why it is volatile.
Pupils learn to write selection with IF, ELSE and ELSE IF in the class's language and read it in AQA pseudo-code.
Pupils learn to describe what RAM, ROM, cache and registers are each used for and why each is needed.
Written for the specifications named. Not endorsed by or affiliated with any exam board.