Shuttle Learning

Lesson 7 – Putting Everything Together (Exam-Style Problems)

In this lesson you will:

  • practise GCSE-style "write an algorithm/program" problems
  • combine inputs, if statements, loops, counters/accumulators, and lists/arrays
  • build confidence with real exam-style wording

By the end you should be able to:

  • identify whether a problem needs a counter-controlled loop or a sentinel-controlled loop
  • track totals correctly using counters and accumulators
  • produce a final report that matches the requirements

Exam Question Set 1

Question 1 (exam-style)

A charity shop records donations as they arrive. Each donation is categorised as:

  • CLOTHES
  • BOOKS
  • TOYS

Write an algorithm that:

  • repeatedly asks for a donation category (CLOTHES/BOOKS/TOYS)
  • updates the correct count for each category
  • allows the manager to type REPORT at any time to display the current totals so far (without stopping)
  • ends when the manager types CLOSE
  • when it ends, displays:
    • the total number of donations in each category
    • the overall total donations

Output

Click "Run Code" to see results here.

Video walkthrough – Question 1

Video: Walkthrough of Question 1

Similar question to try (same skills, different context)

A school tracks lunch choices:

  • HOT
  • COLD
  • VEGAN

Write an algorithm that:

  • repeatedly asks for a lunch choice
  • counts each type
  • allows staff to type STATUS to display totals so far (without stopping)
  • ends when staff type FINISH
  • prints final totals and the overall total

Output

Click "Run Code" to see results here.

Exam Question Set 2

Question 2 (exam-style)

A venue is issuing wristbands for entry.

Rules:

  • If a person is 16 or older, they are allowed in.
  • If a person is 13–15, they are allowed in only if they have a responsible adult with them (YES/NO).
  • If a person is under 13, they are not allowed in.

Write an algorithm that:

  • repeatedly inputs a person's age
  • if needed, asks whether they have a responsible adult (YES/NO)
  • outputs ALLOWED or NOT ALLOWED
  • keeps repeating until 10 people have been allowed entry
  • at the end, prints how many people were not allowed

Output

Click "Run Code" to see results here.

Video walkthrough – Question 2

Video: Walkthrough of Question 2

Similar question to try (same skills, different numbers/rules)

A sports club signs up players:

Rules:

  • Age 18+ can sign up alone
  • Age 15–17 can sign up only if they have guardian permission (YES/NO)
  • Under 15 cannot sign up

Repeat until 6 players have been accepted. Then output how many were rejected.

Output

Click "Run Code" to see results here.

Exam Question Set 3

Question 3 (exam-style)

A teacher has a list of student names:

students = ["Noah", "Amira", "Leo", "Grace", "Ibrahim"]

Write an algorithm using iteration to:

  • display each student name one at a time
  • input whether they are PRESENT, ABSENT, or LATE
  • count the number in each category
  • after all names have been processed, display the three totals

Output

Click "Run Code" to see results here.

Video walkthrough – Question 3

Video: Walkthrough of Question 3

Similar question to try (same skills, different list/context)

A shop checks items on a delivery list:

items = ["Milk", "Bread", "Apples", "Rice"]

For each item, input OK or MISSING and count each. Print totals at the end.

Output

Click "Run Code" to see results here.

Exam Question Set 4

Question 4 (exam-style)

A runner records training distances (in km).

Write an algorithm to:

  • ask how many distances will be entered (n)
  • input n distances (numbers)
  • calculate and output:
    • the total distance
    • the average distance
    • the longest distance entered

Output

Click "Run Code" to see results here.

Video walkthrough – Question 4

Video: Walkthrough of Question 4

Similar question to try (same skills, different context)

A student records test scores.

Ask for n, input n scores, output total, average, and highest score.

Output

Click "Run Code" to see results here.

Exam Question Set 5

Question 5 (exam-style)

A leisure centre charges for swimming sessions:

  • Standard rate: £5 per session
  • If the user is a member: the rate is £3 per session

Write an algorithm that:

  • repeatedly asks for the number of sessions being bought
  • if sessions entered is 0, the program stops
  • otherwise asks if the user is a member (YES/NO)
  • calculates and outputs the cost for that purchase
  • keeps a running total of money taken
  • when the program ends, outputs the total money taken

Output

Click "Run Code" to see results here.

Video walkthrough – Question 5

Video: Walkthrough of Question 5

Similar question to try (same skills, different context/numbers)

A bike hire service charges:

  • Standard: £4 per hour
  • Student: £2 per hour

Repeat purchases until the user enters 0 hours, output each cost and final total taken.

Output

Click "Run Code" to see results here.