Pseudocode Core Structures (Cambridge Standard): Input And Output Statement Structures Examiners Expect (Copy)
Input And Output Statement Structures Examiners Expect (Cambridge Standard – O Level 2210 + IGCSE 0478)
Why INPUT And OUTPUT Are High-Value Marks In Paper 2
- INPUT and OUTPUT statements are:
- The entry and exit points of every algorithm
- The easiest place for examiners to award or withhold marks
- Many candidates lose marks not because logic is wrong, but because:
- INPUT is unclear
- OUTPUT is incomplete
- OUTPUT is placed at the wrong time
Cambridge’s Core Philosophy For INPUT / OUTPUT
- INPUT and OUTPUT must be:
- Explicit
- Traceable
- Clearly linked to the pre-release scenario
- Cambridge does not accept:
- Implied input
- Implied output
- “Assumed” values
Standard INPUT Statement Structure (Cambridge-Safe)
Basic INPUT Format
- INPUT variableName
Examples:
- INPUT score
- INPUT studentID
- INPUT option
- This format is:
- Language-independent
- Fully acceptable in both 2210 and 0478
INPUT With Prompt (Optional But Acceptable)
- OUTPUT “Enter score”
- INPUT score
- Important:
- Prompt is OPTIONAL
- Prompt must not replace INPUT
Multiple INPUT Values
- INPUT name
- INPUT mark
- INPUT classCode
OR
- INPUT name, mark, classCode
- Both formats are acceptable
- Consistency matters more than style
Common INPUT Sources Examiners Expect
| Source | Cambridge Expectation |
|---|---|
| User input | Explicit INPUT statement |
| Menu choice | INPUT option |
| File data | READ / INPUT from file (if specified) |
| Repeated entry | INPUT inside loop |
INPUT Placement Rules (Critical)
- INPUT must appear:
- Before validation
- Before processing
- INPUT inside a loop:
- Means repeated entry
- INPUT outside a loop:
- Means single entry
Examiner Trap
- Writing validation before INPUT
- This shows logical misunderstanding
INPUT And Validation (Correct Structure)
Correct Pattern
- INPUT score
- WHILE score < 0 OR score > 100 DO
- OUTPUT “Invalid score”
- INPUT score
- ENDWHILE
- Examiners reward:
- Clear re-input
- Explicit condition
Incorrect Patterns (Lose Marks)
- Validation without re-input
- Re-input without INPUT statement
- Silent rejection of invalid values
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
OUTPUT Statement Structures Cambridge Expects
Basic OUTPUT Format
- OUTPUT variableName
Examples:
- OUTPUT total
- OUTPUT average
OUTPUT With Text And Variables
- OUTPUT “Total is “, total
- Acceptable alternatives:
- OUTPUT “Total is ” + total
- Both are Cambridge-safe
- Choose one style and stay consistent
OUTPUT Multiple Values
- OUTPUT name, score
- OUTPUT “Name:”, name, “Score:”, score
- Must match:
- Pre-release wording
- Question requirement
OUTPUT Timing Rules (Very High Risk Area)
- OUTPUT must appear:
- After the value is calculated
- OUTPUT inside a loop:
- Means repeated output
- OUTPUT after loop:
- Means final summary
Examiner Trap
- Outputting results before calculation
- Outputting summaries inside loops unintentionally
OUTPUT Conditional Structures
Conditional OUTPUT Example
- IF score >= passMark THEN
- OUTPUT “Pass”
- ELSE
- OUTPUT “Fail”
- ENDIF
- Required when:
- Output depends on condition
- Do not output both branches
OUTPUT For Error Messages
- Error messages are valid outputs
- Must be:
- Clear
- Condition-based
Example:
- OUTPUT “Invalid input”
- Examiner expects:
- Error message linked to validation logic
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
INPUT / OUTPUT And Trace Tables
- Every INPUT:
- Appears as a given value in trace questions
- Every OUTPUT:
- Must be traceable from final variable values
Trace Table Alignment Rule
- If a value is OUTPUT:
- It must exist as a variable
- You cannot output:
- An undeclared or undefined value
INPUT / OUTPUT And Pre-Release Context
- INPUT must:
- Match what the pre-release says is entered
- OUTPUT must:
- Match what the pre-release says is displayed
- Missing one required output:
- Costs marks even if logic is correct
Common INPUT Mistakes (Guaranteed Mark Loss)
- Using READ instead of INPUT without context
- Forgetting INPUT inside loop
- Treating calculated values as inputs
- Not re-inputting after validation failure
Common OUTPUT Mistakes (Guaranteed Mark Loss)
- Outputting wrong variable
- Outputting incomplete information
- Outputting at wrong time
- Adding extra outputs not requested
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
File-Based INPUT And OUTPUT (Only When Specified)
- Only use file INPUT/OUTPUT if:
- Pre-release explicitly mentions files
- Acceptable structures:
File INPUT
- OPENFILE fileName FOR READ
- READ fileName, record
- CLOSEFILE fileName
File OUTPUT
- OPENFILE fileName FOR WRITE
- WRITE fileName, record
- CLOSEFILE fileName
- Do not invent file handling
Examiner Preference: Simplicity And Clarity
- Examiners prefer:
- Clear INPUT statements
- Clear OUTPUT statements
- Over-formatting:
- Not required
- Not rewarded
INPUT / OUTPUT And Section B Questions
- In modifications:
- INPUT usually stays unchanged
- OUTPUT is often restricted or extended
- Always check:
- Does the question change what is displayed?
- Does it change when it is displayed?
The “IPO Consistency Check” (Before You Finish)
- Every INPUT:
- Is used in a process
- Every OUTPUT:
- Comes from a processed value
- No unused INPUT
- No unexplained OUTPUT
Best-Practice INPUT / OUTPUT Strategy For Paper 2
- Use INPUT explicitly
- Place INPUT before validation
- Place OUTPUT after calculation
- Match pre-release wording
- Keep output minimal and precise
Final Lock-In Rules
- INPUT is never implied
- OUTPUT timing matters as much as content
- Error messages are outputs
- Do not invent extra INPUT or OUTPUT
- Clear INPUT/OUTPUT = easy marks for examiner
