- Create and test a complete Cinema Ticket Calculator
- Record normal, extreme and exceptional test evidence
- Fix errors and explain the finished solution clearly
- 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
Child
12 then 13Adult
13 and 64Senior
64 then 65Boundary tests sit on either side of where the rule changes. They are stronger than only testing easy middle values.
| Age | Ticket type | Price |
|---|---|---|
| Under 13 | Child | 4.50 |
| 13 to 64 | Adult | 7.50 |
| 65 or over | Senior | 5.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:
- Ask how many tickets are being bought.
- Use a loop to ask for each person's age.
- Use selection to choose child, adult or senior price.
- Keep a running total.
- Display the final total formatted clearly.
- 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)- 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)
- 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)
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
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
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.