N3/N4  ·  SDD  ·  Software Design & Development

Outcome 2 Assessed Task — Cinema Ticket Calculator

National 3 & National 4 Computing Science Lesson SDD9 of 10 Approx 60 min
Learning intentions
  • Create and test a complete Cinema Ticket Calculator
  • Record normal, extreme and exceptional test evidence
  • Fix errors and explain the finished solution clearly
Success criteria
  • I can combine input, variables, arithmetic, selection and iteration in one program
  • I can test using supplied data and record expected and actual results
  • I can describe fixes made after testing

Outcome 2 Assessed Task — Cinema Ticket Calculator

The brief

Create a Python program that calculates the total cost for a group going to the cinema. The program should ask how many tickets are needed, ask for each person's age, choose the correct ticket price, build a running total, then display the total cost.

Required price rules

AgeTicket typePrice
Under 13Child4.50
13 to 64Adult7.50
65 or overSenior5.00

What this task assesses

This task focuses on creating, testing and refining a software solution. National 3 pupils need to create and test a working solution using supplied data. National 4 pupils need to combine constructs and data types, test using supplied data, and fix errors found during testing.

Assessment Task

Practical Task 1 — Build the Cinema Ticket Calculator

Your program must:

  1. Ask how many tickets are being bought.
  2. Use a loop to ask for each person's age.
  3. Use selection to choose child, adult or senior price.
  4. Keep a running total.
  5. Display the final total formatted clearly.
  6. Include comments and sensible variable names.
tickets = int(input("How many tickets? ")) total = 0.0 for count in range(tickets): age = int(input("Age: ")) if age < 13: price = 4.50 elif age < 65: price = 7.50 else: price = 5.00 total = total + price print("Total cost:", total)
N3 evidence checklist
  • Working solution created from the brief (N3 O1.1)
  • Program tested with supplied data (N3 O1.2)
  • Simple errors fixed and retested (N3 O1.3)
N4 evidence checklist (builds on N3)
  • Uses variables, numeric data, selection and iteration together (N4 O2.1)
  • Tests with supplied normal and boundary data (N4 O2.2)
  • Records any errors found, fixes made and retests (N4 O2.3)
Evidence Questions

Complete these with your final program.

1. Which ages are best boundary tests for the adult ticket rule? TYPE 1

2. For ages 10, 13 and 70, what total should the program output? TYPE 1

3. Paste your final program and test table. Your table must include expected result, actual result and pass/fail. TYPE 3

4. Describe one error you found or one error you deliberately checked for, and how you fixed or avoided it. TYPE 2 N4

Example: I tested age 13 because it is the boundary between child and adult. If the program used age <= 13 for child tickets, age 13 would be wrongly charged 4.50. I fixed this by using age < 13.

5. Explain how the loop and selection work together in this program. TYPE 2 N4

The loop repeats once for each ticket. During each pass, selection checks the person's age and chooses the correct price. The chosen price is then added to the running total.
Teacher notes — Shift+T to hide

Assessment standards covered: N3 O1.1, O1.2, O1.3; N4 O2.1, O2.2, O2.3. The price rules provide supplied test data boundaries.