[go: up one dir, main page]

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

Chapter7 8 Definitions Revision Guide

The document serves as a revision guide for IGCSE Computer Science, covering key definitions and concepts in algorithm design, problem solving, and programming. It includes detailed notes on algorithms, pseudocode examples, and essential exam tips. Key topics include data validation, error types, programming structures, and file handling, along with practical pseudocode examples for various tasks.

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)
24 views8 pages

Chapter7 8 Definitions Revision Guide

The document serves as a revision guide for IGCSE Computer Science, covering key definitions and concepts in algorithm design, problem solving, and programming. It includes detailed notes on algorithms, pseudocode examples, and essential exam tips. Key topics include data validation, error types, programming structures, and file handling, along with practical pseudocode examples for various tasks.

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 – Definitions &

Revision Guide (Chapters 7 & 8)

Includes detailed notes, definitions of key terms, pseudocode,


trace tables & exam tips.
■ Chapter 7 – Algorithm Design & Problem Solving
■ **Definitions:**
• Algorithm → A step-by-step method for solving a problem.
• Flowchart → A diagram that shows the sequence of steps in a process using symbols.
• Pseudocode → Structured English-like notation for writing algorithms.
• Decomposition → Breaking a problem into smaller, manageable parts.
• Validation → Checks if input data is sensible and within acceptable limits.
• Verification → Ensures data entered matches the original source.
• Normal Data → Typical, valid input data.
• Boundary Data → Data at the edge of valid ranges.
• Abnormal Data → Invalid data used for testing error handling.
• Trace Table → A table used to track changes in variables as an algorithm runs.
• Syntax Error → Mistake in the rules of the programming language.
• Logic Error → The program runs but gives the wrong result.
• Runtime Error → Error that occurs while the program is running (e.g., divide by zero).
■ Chapter 8 – Programming
■ **Definitions:**
• Variable → A named storage location in memory that can change value.
• Constant → A storage location with a fixed value that cannot change.
• Sequence → Executing instructions in the order they appear.
• Selection → Using conditions (IF, ELSE) to choose between actions.
• Iteration → Repeating a block of instructions (loops).
• Operator → Symbol used to perform operations (arithmetic, relational, logical).
• String → A sequence of characters.
• Concatenation → Joining two or more strings together.
• Substring → A smaller part of a string.
• Procedure → A subroutine that performs a task but does not return a value.
• Function → A subroutine that performs a task and returns a value.
• Parameter → A value passed into a subroutine.
• Local Variable → Exists only inside a subroutine.
• Global Variable → Can be accessed anywhere in the program.
• Array → A collection of data items stored under one name (1D or 2D).
• File Handling → Opening, reading, writing, and closing files to store data permanently.
• IDE (Integrated Development Environment) → Software with tools for coding, debugging, and
testing.
■■ 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 – Key Terms & Must-Know
Points
■■ PDLC = Analysis → Design → Coding → Testing → Maintenance
■ Validation = Sensible? (Range, Type, Format, Length, Presence)
■ 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 value)
■■ Must-know Pseudocode = Linear Search, Bubble Sort, Totalling, Counting, Arrays, File
handling

You might also like