[go: up one dir, main page]

0% found this document useful (0 votes)
5 views8 pages

Chapter7 8 Final Revision Guide

The IGCSE Computer Science Final Revision Guide covers key concepts in algorithm design, problem solving, and programming, including the Program Development Life Cycle (PDLC), data validation and verification, and various programming structures. It provides essential pseudocode examples for common programming tasks such as totalling, searching, and sorting, alongside good programming practices. Additionally, it includes a summary of important topics for last-minute exam preparation.

Uploaded by

Zephy Tron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

Chapter7 8 Final Revision Guide

The IGCSE Computer Science Final Revision Guide covers key concepts in algorithm design, problem solving, and programming, including the Program Development Life Cycle (PDLC), data validation and verification, and various programming structures. It provides essential pseudocode examples for common programming tasks such as totalling, searching, and sorting, alongside good programming practices. Additionally, it includes a summary of important topics for last-minute exam preparation.

Uploaded by

Zephy Tron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

■ IGCSE Computer Science – Final Revision Guide

(Chapters 7 & 8)

Your complete study notes with explanations, examples,


pseudocode, trace tables & exam tips.
■ Chapter 7 – Algorithm Design & Problem Solving
■■ **Program Development Life Cycle (PDLC):**
1. **Analysis** ■ – Understand the problem, identify inputs, processes, outputs.
2. **Design** ✏■ – Plan solution using flowcharts, pseudocode, structure diagrams.
3. **Coding** ■ – Write program in chosen language.
4. **Testing** ■ – Run with normal, boundary, abnormal data.
5. **Maintenance** ■ – Update program, fix bugs, adapt to new needs.
■ **Decomposition:**
• Break down complex problem into smaller sub-problems (like LEGO ■).
• Each part can be solved/tested separately → easier debugging.
■ **Algorithms:**
• Step-by-step instructions for solving problems.
• Represent using **flowcharts** (visual) or **pseudocode** (text).
• Must be clear, unambiguous, and finite.
■ **Standard Methods of Solution:**
• Totalling (sum of items).
• Counting (items meeting a condition).
• Finding Maximum, Minimum, Average.
• Searching (Linear Search).
• Sorting (Bubble Sort).
■ **Validation vs Verification:**
• Validation = Check data is sensible:
– Range (age between 0–120).
– Length (password = 8 chars).
– Type (numeric only).
– Format (email must have ‘@’).
– Presence (required field not empty).
• Verification = Check data entered correctly:
– Double entry (enter password twice).
– Visual check (read back and confirm).
■ **Test Data Types:**
• Normal = typical input (e.g., 35 in age 0–120).
• Boundary = values at limits (e.g., 0 or 120).
• Abnormal = invalid (e.g., -5, 'abc').
■ **Trace Tables & Dry Runs:**
• Show how variable values change line by line.
• Help detect **logic errors** (wrong calculations).
• Dry run = manually simulating the program.
■■ **Types of Errors:**
• Syntax Error ■ – breaks rules (missed bracket, wrong keyword).
• Logic Error ■ – program runs but result wrong.
• Runtime Error ■ – crashes (divide by 0, file not found).
■ **Tips:**
• Use clear variable names.
• Modular design = easier to test.
• Always test with **all types of test data**.
■ Chapter 8 – Programming
■ **Variables & Constants:**
• Variables = can change value.
• Constants = fixed, cannot change (e.g., PI = 3.14).
• Use meaningful names (age, score).
■ **Control Structures:**
• Sequence → steps run in order.
• Selection → decisions (IF, ELSE, CASE).
• Iteration → repetition:
– FOR → known number of times.
– WHILE → repeat while condition true.
– REPEAT UNTIL → runs at least once, stops when condition true.
■ **Operators:**
• Arithmetic: +, -, *, /, MOD, DIV.
• Relational: >, <, >=, <=, =, ≠ .
• Logical: AND, OR, NOT.
■ **String Handling:**
• Concatenation (join strings).
• Length (number of characters).
• Substring (part of a string).
• Example: LEFT(name,3) → first 3 letters.
■ **Subroutines:**
• Procedures → perform tasks, no return value.
• Functions → return a value.
• Parameters → values passed in.
• Local variables → exist only inside subroutine.
• Global variables → used across whole program.
■ **Arrays:**
• 1D Array = list of items (e.g., names[10]).
• 2D Array = table/matrix (e.g., marks[5][5]).
• Use loops to process arrays.
■ **File Handling:**
• OPEN file in READ or WRITE mode.
• READFILE line by line.
• WRITEFILE to save data.
• CLOSE file after use.
• Prevents data loss and corruption.
■ **Good Programming Practice:**
• Indentation → clear structure.
• Comments → explain logic.
• Meaningful names → easy to understand.
• Subroutines → reusable, reduces complexity.
■■ Pseudocode Examples
■ Totalling
total ← 0
FOR counter ← 1 TO 5
INPUT number
total ← total + number
NEXT counter
OUTPUT total

■ Counting
count ← 0
FOR counter ← 1 TO 10
INPUT mark
IF mark >= 50 THEN
count ← count + 1
ENDIF
NEXT counter
OUTPUT count

■ Find Max/Min
INPUT firstNumber
max ← firstNumber
min ← firstNumber
FOR counter ← 2 TO 10
INPUT number
IF number > max THEN
max ← number
ENDIF
IF number < min THEN
min ← number
ENDIF
NEXT counter
OUTPUT "Max = ", max
OUTPUT "Min = ", min

■ Linear Search
found ← FALSE
index ← 0
INPUT searchItem
WHILE index < arrayLength AND found = FALSE
IF array[index] = searchItem THEN
found ← TRUE
ELSE
index ← index + 1
ENDIF
ENDWHILE
IF found = TRUE THEN
OUTPUT "Item found at position ", index
ELSE
OUTPUT "Item not found"
ENDIF

■ Bubble Sort
FOR pass ← 1 TO arrayLength - 1
FOR index ← 0 TO arrayLength - 2
IF array[index] > array[index+1] THEN
temp ← array[index]
array[index] ← array[index+1]
array[index+1] ← temp
ENDIF
NEXT index
NEXT pass

■ IF / ELSE
INPUT age
IF age >= 18 THEN
OUTPUT "Adult"
ELSE
OUTPUT "Not Adult"
ENDIF

■ WHILE Loop
count ← 0
WHILE count < 5
OUTPUT "Hello"
count ← count + 1
ENDWHILE

■ REPEAT…UNTIL
REPEAT
INPUT number
UNTIL number >= 0

■ FOR Loop
FOR counter ← 1 TO 10
OUTPUT counter
NEXT counter

■ Procedure
PROCEDURE greet(name)
OUTPUT "Hello ", name
ENDPROCEDURE
CALL greet("Ali")

■ Function
FUNCTION square(number)
RETURN number * number
ENDFUNCTION
result ← square(5)
OUTPUT result

■ 1D Array
FOR index ← 0 TO 4
INPUT names[index]
NEXT index
FOR index ← 0 TO 4
OUTPUT names[index]
NEXT index
■ 2D Array
FOR row ← 0 TO 2
FOR col ← 0 TO 2
INPUT marks[row][col]
NEXT col
NEXT row

■ File Write
OPENFILE "data.txt" FOR WRITE
FOR i ← 1 TO 5
INPUT item
WRITEFILE "data.txt", item
NEXT i
CLOSEFILE "data.txt

■ File Read
OPENFILE "data.txt" FOR READ
WHILE NOT EOF("data.txt")
READFILE "data.txt", item
OUTPUT item
ENDWHILE
CLOSEFILE "data.txt
■ Trace Table Example (Average Calculator)
Algorithm (Average of 3 numbers):
count ← 0
total ← 0
FOR i ← 1 TO 3
INPUT number
total ← total + number
count ← count + 1
NEXT i
average ← total / count
OUTPUT average

i number total count


1 4 4 1
2 6 10 2
3 8 18 3
average = 18 / 3 = 6 OUTPUT = 6
■ Exam Booster Sheet – Last Minute Revision
■■ PDLC = Analysis → Design → Coding → Testing → Maintenance
■ Validation = Sensible? (Range, Type, Format)
■ Verification = Correct? (Double entry, Visual check)
■ Test Data = Normal, Boundary, Abnormal
■ Errors = Syntax ■, Logic ■, Runtime ■
■ Structures = Sequence, IF/ELSE, FOR, WHILE, REPEAT UNTIL
■ Variables (change), Constants (fixed)
■ Arrays = 1D (list), 2D (table)
■ Files = OPEN, READ, WRITE, CLOSE
■ Subroutines = Procedure (no return), Function (returns)
■■ Must-know Pseudocode = Linear Search, Bubble Sort, IF, Loops, Arrays, File handling

You might also like