AQA 8525 GCSE Computer Science · 3.2 Programming
Stretch tasks Programming Fundamentals
Quiz Challenge
A quiz game against four computer players, then short and long written answers.
- Quiz Blitz12 questions against the clock
- Quick Fire4 short answers
- Big Think2 long answers
About 20 minutes
This or That
Pixel the cat asks 8 questions. Each has two answers: pick the right one.
- Two answers to every question
- A fish treat for every right answer
- Streaks win Pixel shades, then a party hat
About 4 minutes
Memory Match
Flip the cards two at a time to match each expression card to its value card.
- 12 cards: each expression has a value
- One peek at every card
- Combo points for pairs found in a row
6 pairs, about 4 minutes
Sort It
Sort each statement into the right box, like the tick-box tables in the exam.
- 12 cards to sort into 4 boxes
- Drag a card, tap a box or press its number
- Combo points for cards sorted in a row
12 cards, about 4 minutes
The games need JavaScript. Every question is below, with the answers at the end.
Read the lesson: Programming Fundamentals
Programming Fundamentals: the questions
Quiz Challenge, round 1: Quiz Blitz
Which AQA data type holds a single letter such as 'K'?
- String
- Integer
- Boolean
- Character
What is output?
OUTPUT 7 DIV 2What is output?
OUTPUT 7 MOD 2What is output?
OUTPUT 7 / 2What does count ← count + 1 do?
- Makes count a constant
- Sets count to 1
- Adds 1 to count and stores the result back in count
- Checks whether count equals count + 1
Why does IF grade = 'A' OR 'B' not work?
- Each side of OR must be a complete comparison
- OR cannot be used with strings
- IF always needs an ELSE
- Grades must be integers
Every relational operator, such as < or ≥, produces a Boolean.
- True
- False
A mark of 80 is entered. What is grade?
IF mark ≥ 40 THEN grade ← 'Pass' ELSE IF mark ≥ 70 THEN grade ← 'Distinction' ENDIF- Distinction
- Nothing
- An error
- Pass
How can you test whether n is even?
- n DIV 2 = 0
- n / 2 = 1
- n MOD 2 = 1
- n MOD 2 = 0
seconds ← 135. What is seconds DIV 60?
Which is count-controlled iteration?
- WHILE password ≠ stored
- REPEAT ... UNTIL found
- IF x > 5 THEN
- FOR i ← 1 TO 5
Which TWO are reasons to use a constant?
Tick 2.
- The value is changed in only one place
- The program cannot change it by accident
- It saves typing the name
- It makes loops run faster
- It lets users edit the value
Quiz Challenge, round 2: Quick Fire
Explain why the bit pattern 01000001 needs a data type before it can be used. [2 marks]
Explain how DIV and MOD can turn 135 seconds into minutes and seconds. [2 marks]
Explain the difference between count-controlled and condition-controlled iteration. [2 marks]
A program gives Distinction for 70 or more and Pass for 40 or more. Explain why the order of its IF and ELSE IF tests matters. [2 marks]
Quiz Challenge, round 3: Big Think
Write an algorithm in AQA pseudo-code that keeps asking for a password until it matches the stored one, then displays a welcome message. [4 marks]
A program stores a VAT rate of 0.2 and uses it in many calculations. Explain why it should be a constant, and how a constant differs from a variable. [4 marks]
This or That: tick the right answer
Which data type is 2.0?
- Integer
- Real
Which data type is "7"?
- Integer
- String
Which AQA symbol means not equal to?
- ←
- ≠
seconds ← 135. What is seconds MOD 60?
- 15
- 2
Which keyword declares a fixed value in AQA pseudo-code?
- CONSTANT
- FIXED
What does n MOD 10 give?
- The last digit of n
- n divided by 10
IF age ≥ 13 AND age ≤ 19. Which age makes it true?
- 21
- 15
A loop must process every item in a list of known length. Which loop suits it?
- A condition-controlled REPEAT loop
- A count-controlled FOR loop
Memory Match: match each expression to its value
| Expression | Value |
|---|---|
A 7 / 2 | 1 3 |
B 7 DIV 2 | 2 1 |
C 7 MOD 2 | 3 7 |
D 135 DIV 60 | 4 3.5 |
E 135 MOD 60 | 5 2 |
F 2 * 3 + 1 | 6 15 |
Sort It: tick one box in each row
Which AQA data type suits each value?
| Statement | Integer | Real | Character | String |
|---|---|---|---|---|
| A postcode | ||||
| An empty string, "" | ||||
| -0.5 | ||||
| -40 | ||||
| 3.14 | ||||
| A height of 1.75 metres | ||||
| The number of people in a queue | ||||
| One digit character, such as '7' | ||||
| 2025 | ||||
| "Hello" | ||||
| A single initial, such as 'J' | ||||
| 'K' |
Answers
Round 1: Quiz Blitz
- Character A character is one character. A string is a sequence of them.
- 3 DIV keeps only the whole number part: 2 goes into 7 three times.
- 1 MOD gives the remainder: 7 is 3 x 2 with 1 left over.
- 3.5 / is real division, so the answer keeps its fractional part.
- Adds 1 to count and stores the result back in count Work out the right-hand side, then store it in the name on the left.
- Each side of OR must be a complete comparison It must be IF grade = 'A' OR grade = 'B'. Examiners set this trap deliberately.
- True That is their whole point: selection and iteration can then test the result.
- Pass 80 ≥ 40 is true, so the first branch runs and the rest is skipped. The most restrictive test must come first.
- n MOD 2 = 0 An even number leaves no remainder when divided by 2.
- 2 60 goes into 135 twice: 2 whole minutes.
- FOR i ← 1 TO 5 The number of repeats is known before the loop starts.
- The value is changed in only one place; The program cannot change it by accident A named constant also makes the code more readable: price vat, not price 0.2.
Round 2: Quick Fire
- The same bits could be the integer 65 or the character A
- The type tells the computer how to interpret the bits
Model answerThe same bits could be the integer 65, the character A, or part of a real number. The data type tells the computer how to interpret the bits.
- 135 DIV 60 is 2, the whole minutes
- 135 MOD 60 is 15, the seconds left over
Model answer135 DIV 60 is 2, the whole number of minutes. 135 MOD 60 is 15, the seconds left over. So 135 seconds is 2 minutes 15 seconds.
- Count-controlled repeats a number of times known before it starts
- Condition-controlled repeats until a condition changes, an unknown number of times
Model answerCount-controlled iteration, such as a FOR loop, repeats a number of times known before it starts. Condition-controlled iteration, such as WHILE or REPEAT, repeats until a condition changes, so the number of repeats is unknown.
- A mark such as 80 meets both tests
- The first true test wins, so the most restrictive must come first
Model answerA mark such as 80 meets both tests, and only the first true test runs, so the most restrictive test, 70 or more, must come first, or every passing student gets a Pass.
Round 3: Big Think
- Uses a REPEAT or WHILE loop
- Takes the password with USERINPUT
- Compares the entry with the stored password
- Outputs the message after the loop
Model answerAQA pseudo-codeREPEAT password ← USERINPUT UNTIL password = stored OUTPUT 'Welcome'- A constant is fixed and cannot change while the program runs
- A variable's value can change
- A named constant makes the code more readable
- If the rate changes, it is edited in one place
- The program cannot change it by accident
Model answerA constant is fixed when the program is written and cannot be changed while it runs, whereas a variable's value can change. Using a constant such as vat makes the code more readable, because price * vat explains itself. If the rate changes, it is edited in one place rather than everywhere 0.2 appears, and the program cannot change it by accident.
This or That
- Real It has a fractional part, even though it is zero.
- String In quotes, 7 is a character string that just looks like a digit.
- ≠ ← is assignment. ≠ is the relational operator not equal to.
- 15 MOD gives what is left over: 135 is 2 x 60 with 15 left over.
- CONSTANT For example, CONSTANT vat ← 0.2.
- The last digit of n The remainder after dividing by 10 is the units digit.
- 15 AND needs both comparisons to be true, and 21 is more than 19.
- A count-controlled FOR loop The number of repeats is known, so a FOR loop is the right choice, and saying why earns the mark.
Memory Match
- A 4
7 / 2: 3.5 - B 1
7 DIV 2: 3 - C 2
7 MOD 2: 1 - D 5
135 DIV 60: 2 - E 6
135 MOD 60: 15 - F 3
2 * 3 + 1: 7
Sort It
- String A postcode It mixes letters, digits and a space.
- String An empty string, "" A string can hold no characters at all.
- Real -0.5 A real can be negative and fractional.
- Integer -40 A whole number, positive or negative, is an integer.
- Real 3.14 It has a fractional part.
- Real A height of 1.75 metres Heights need a fractional part.
- Integer The number of people in a queue You cannot have half a person.
- Character One digit character, such as '7' In quotes, '7' is a character, not a number.
- Integer 2025 A whole number with no fractional part.
- String "Hello" A sequence of characters is a string.
- Character A single initial, such as 'J' One character on its own.
- Character 'K' A single character.