Pseudocode Foundations & Conventions: Common Syntax Mistakes Students Make In Pseudocode (Copy)
Common Syntax Mistakes Students Make In Pseudocode
Why Syntax Mistakes Cost Easy Marks
- Even with correct logic, syntax mistakes confuse examiners
- Most syntax errors:
- Break structure
- Make intent unclear
- Prevent correct tracing
- These are avoidable mistakes, not concept gaps
Mistake 1: Using = Instead Of ← For Assignment
| Incorrect | Why Wrong | Correct |
|---|---|---|
| Total = 10 | = is comparison |
Total ← 10 |
Correct Pattern
Total ← 10
IF Total = 10 THEN
OUTPUT "Correct"
ENDIF
←= assignment== comparison only
Mistake 2: Writing Multiple Actions On One Line
| Incorrect | Problem |
|---|---|
| IF Age>=18 THEN OUTPUT “Yes” ELSE OUTPUT “No” | Hard to trace |
Correct (Examiner-Friendly)
IF Age >= 18 THEN
OUTPUT "Yes"
ELSE
OUTPUT "No"
ENDIF
- One action per line
- Clear block structure
Mistake 3: Missing Or Incorrect END Keywords
| Common Error | Result |
|---|---|
| Missing ENDIF | Block ambiguity |
| Using END instead of ENDIF | Invalid structure |
Correct Block Closure
IF Score >= 50 THEN
OUTPUT "Pass"
ENDIF
| Starter | Correct Ending |
|---|---|
| IF | ENDIF |
| FOR | ENDFOR |
| WHILE | ENDWHILE |
| CASE | ENDCASE |
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 AS Level Computer Science Full Scale Course
Mistake 4: Incorrect Indentation
| Incorrect | Problem |
|---|---|
| No indentation | Logic unclear |
| Random indentation | False nesting |
Correct Indentation
WHILE Count < 5 DO
INPUT Value
Count ← Count + 1
ENDWHILE
- All loop content indented
- END aligned with loop start
Mistake 5: Using Language-Specific Keywords
| Incorrect Keyword | Why Wrong | Correct |
|---|---|---|
| Language-specific | OUTPUT | |
| READ | Language-specific | INPUT |
| == | Programming syntax | = |
- Pseudocode must be language-neutral
Mistake 6: INPUT With Text Inside
| Incorrect | Why Wrong |
|---|---|
| INPUT “Enter age” | INPUT is data-only |
Correct Pattern
OUTPUT "Enter age"
INPUT Age
- OUTPUT gives instruction
- INPUT receives value
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 AS Level Computer Science Full Scale Course
Mistake 7: Uninitialised Variables
| Example | Problem |
|---|---|
| Total ← Total + Value | Total undefined |
Correct Initialisation
Total ← 0
Total ← Total + Value
| Variable Type | Initial Value |
|---|---|
| Counter | 0 |
| Total | 0 |
| BOOLEAN | FALSE |
| STRING | “” |
Mistake 8: Wrong Loop Choice
| Wrong Choice | Why Wrong |
|---|---|
| FOR when count unknown | Poor logic |
| WHILE when must run once | Validation fails |
Correct Loop Selection
| Situation | Loop |
|---|---|
| Fixed repetitions | FOR |
| Condition-based | WHILE |
| Must run once | REPEAT UNTIL |
Mistake 9: Using UNTIL Like WHILE
| Incorrect | Why Wrong |
|---|---|
| UNTIL Age < 0 | Logic inverted |
Correct Understanding
REPEAT
INPUT Age
UNTIL Age >= 0 AND Age <= 120
- REPEAT runs
- UNTIL stops when condition becomes TRUE
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 AS Level Computer Science Full Scale Course
Mistake 10: Confusing Assignment And Comparison In IF
| Incorrect | Why Wrong |
|---|---|
| IF Total ← 10 THEN | Assignment inside IF |
Correct
IF Total = 10 THEN
OUTPUT "Correct"
ENDIF
Mistake 11: Inconsistent Identifier Names
| Example | Problem |
|---|---|
| TotalMarks vs Total | Ambiguity |
| count vs Count | Tracing confusion |
Correct Practice
DECLARE TotalMarks : INTEGER
TotalMarks ← 0
TotalMarks ← TotalMarks + Score
- Same spelling
- Same case
- Same meaning
Mistake 12: Using Keywords As Identifiers
| Incorrect | Why Wrong |
|---|---|
| DECLARE IF : INTEGER | Reserved word |
| DECLARE FOR : INTEGER | Reserved word |
- Keywords must never be used as identifiers
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 AS Level Computer Science Full Scale Course
Mistake 13: Over-Compressed Calculations
| Poor Practice | Issue |
|---|---|
| A ← B + C + D | Hard to trace |
Examiner-Friendly
Temp ← B + C
A ← Temp + D
- Shows working
- Prevents arithmetic ambiguity
Mistake 14: Missing Output Labels
| Incorrect | Problem |
|---|---|
| OUTPUT Total | Meaning unclear |
Correct
OUTPUT "Total = ", Total
- Labels help examiners award marks quickly
Mistake 15: Forgetting To Update Loop Control Variables
| Example | Problem |
|---|---|
| WHILE i < 5 DO | Infinite loop |
Correct
WHILE i < 5 DO
i ← i + 1
ENDWHILE
Syntax Safety Checklist (Exam Use)
| Checkpoint | Status |
|---|---|
| Assignment uses ← | ✓ |
| All blocks closed | ✓ |
| Variables initialised | ✓ |
| Correct keywords used | ✓ |
| Indentation consistent | ✓ |
| One action per line | ✓ |
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 AS Level Computer Science Full Scale Course
