Card 21: Exam Technique

Module 7: Expert Techniques

1 The Examiner's Secret

Examiners don't read every line of code. They look for Marking Points.

IPO + Loop is the magic formula for 6-mark questions:

  • Input (Ask for data) - 1 Mark
  • Process (Do the math/logic) - 2 Marks
  • Output (Show the result) - 1 Mark
  • Loop (Repeat until done) - 1-2 Marks

2 Worked Example

"Write an algorithm to calculate ticket prices." (6 Marks)

# 1. INPUT (1 Mark)
tickets = int(input("How many tickets? "))
# 2. PROCESS (Calculation) (1 Mark)
price = tickets * 10
# 3. PROCESS (Selection/Logic) (1 Mark)
if tickets > 5:
price = price * 0.9 # Discount
# 4. OUTPUT (1 Mark)
print("Total: " + str(price))

PREDICT: Mark This Code

A student wrote this for a "Positive Number" check. How many marks (out of 3)?

num = input("Enter num: ")
if num > 0:
  print("Positive")
BRONZE (DEBUGGING)

🥉 The Broken Logic

Examiners love "Off By One" errors or incorrect logic operators.
This code should loop while number is NOT 10.
But it uses or instead of != (or similar logic). Fix it.

> _
SILVER (TRACE)

🥈 Predict the Output

Examiners ask you to "Trace" loops. Predict what total will be.
Task: Run the code and see if you were right. (Correct answer is printed).

> _
GOLD (EXAM QUESTION)

🥇 The 6-Mark Algorithm

Question: Write a program that asks for a Password.
- It must be longer than 5 letters (Validation).
- It must NOT be "password" (Security).
- Keep asking until valid.
- Print "Access Granted" at the end.

> _