Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Unit 7 Revision Notes

This document provides summarized notes on the CAIE IGCSE Computer Science theory syllabus, focusing on algorithm design, problem-solving, and program development life cycle. It covers essential concepts such as program analysis, design, coding, testing, and maintenance, along with tools like pseudocode and flowcharts. Additionally, it discusses data types, test data, and validation techniques necessary for effective algorithm writing.

Uploaded by

taiduc0806
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Unit 7 Revision Notes

This document provides summarized notes on the CAIE IGCSE Computer Science theory syllabus, focusing on algorithm design, problem-solving, and program development life cycle. It covers essential concepts such as program analysis, design, coding, testing, and maintenance, along with tools like pseudocode and flowcharts. Additionally, it discusses data types, test data, and validation techniques necessary for effective algorithm writing.

Uploaded by

taiduc0806
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ZNOTES.

ORG

UPDATED TO 2023-2025 SYLLABUS

CAIE IGCSE
COMPUTER SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
Prepared for Raymond Catarata for personal use only.
CAIE IGCSE COMPUTER SCIENCE

The program or set of programs is developed based on


1. Algorithm Design & the design.
Each module of the program is written using a suitable
Problem-Solving programming language.
Testing is conducted to ensure that each module
functions correctly.
1.1. Program Development Life Cycle Iterative testing is performed, which involves conducting
(PDLC) modular tests, making code amendments if necessary,
and repeating tests until the module meets the required
Analysis functionality.
Design
Coding Testing
Testing
Maintenance The completed program or set of programs is executed
multiple times using various test data sets.
Analysis This testing process ensures that all the tasks within the
program work together as specified in the program
Before solving a problem, it is essential to define and design.
document the problem clearly, known as the Running the program with different test data can identify
"requirements specification" for the program. and address potential issues and errors.
The analysis stage involves using tools like abstraction The testing phase aims to verify the overall functionality
and decomposition to identify the specific requirements and performance of the program by evaluating its
for the program. behaviour with various inputs.
Abstraction focuses on the essential elements needed
for the solution while eliminating unnecessary details 1.2. Structure Diagrams
and information.
Decomposition involves breaking down complex Every computer system is made up of sub-systems,
problems into smaller, more manageable parts that can which are in turn made up of further sub-systems.
be solved individually. Structure Diagrams – The breaking down of a computer
Daily tasks can be decomposed into constituent parts for system into sub-systems, then breaking each sub-system
easier understanding and solving. into smaller sub-systems until each one only performs a
single action. A structure diagram diagrammatically
Design represents a top-down design. Example below.
The program specification derived from the analysis
stage is used as a guide for program development.
During the design stage, the programmer should clearly
understand the tasks to be completed, the methods for
performing each task, and how the tasks will work
together.
Documentation methods such as structure charts,
flowcharts, and pseudocode can be used to document
the program's design formally. 1.3. Pseudocode & Flowcharts
Coding and iterative testing

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

Pseudocode - Verbal representation of an algorithm (a Declaration & Usage of Variables & Constants
process or set of steps) and flowcharts are a Variable – Store of data which changes during
diagrammatic representation. execution of the program (due to user input)
Flowcharts: A flowchart shows diagrammatically the Constant – Store of data that remains the same
steps required to complete a task and the order that during the execution of the program
they are to be performed Basic Data Types
Algorithm: These steps, together with the order, are Integer – Whole Number e.g. 2; 8; 100
called an algorithm Real – Decimal Number e.g. 7.00; 5.64
Char – Single Character e.g. a; Y
String – Multiple Characters (Text) e.g. ZNotes; COOL
Boolean – Only 2 Values e.g. True/False; Yes/No; 0/1
Input & Output (READ & PRINT) – Used to receive and
display data to the user respectively. (It is recommended
to use input and output commands)
INPUT Name
OUTPUT "Hello Mr." , Name

// Alternatively //

READ Name
PRINT "Hello Mr," , Name
An example of a flowchart is given below from a past paper
question in which all of the functions of a flowchart are Declaration of variable - A variable/constant can be
shown: declared by the following manner

DECLARE [Variable Name] : [DATATYPE OF VARIABLE]

Array: Array is similar to variable but it can store


multiple values of same datatype under single name
DECLARE [ARRAYNAME] : ARRAY [Lower Limit : Upper Lim

Assignment - Each variable is assigned using a left


arrow.

[VARIABLE NAME] <---- [Value to be assigned]


ArrayName [IndexValue] <---- [Value to be assigned]

Conditional Statements:
This flowchart’s task is to check if a rider’s height is more the IF…THEN…ELSE…ENDIF
requirement (1.2) in this case. It then counts until the
accepted riders are 8. After they are 8, it outputs the
number of rejected riders and tells the rest that they are
ready to go!

2. Pseudocode

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

Loop Structures:
FOR…TO…NEXT : Will run for a determined/known

REPEAT… UNTIL – Will run at least once till condition is


satisfied; Verification is done after running code

CASE…OF…OTHERWISE…ENDCASE – Multiple conditions and


corresponding consequences \n

WHILE…DO…ENDWHILE – May not ever run; Verification


is done before running code

Note: When using conditions in these loop structures


and conditional statement, it has to be kept in mind that
it can be done in two ways.
1. use of a Boolean variable that can have the value
TRUE or FALSE
2. comparisons made by using coparison operators,
where comparisons are made from left to right

IF [BOOLEAN VARIABLE]
THEN
OUTCOME
ELSE
OUTCOME
ENDIF

IF ((CONDITION 1) OR ( CONDITION 2)) AND (CONDITION


THEN
OUTCOME
ELSE
OUTCOME
ENDIF

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

MaxiumumValue <--- Array[1] MinimumValue <--- Array[


2.1. FOR Counter ← 2 TO LoopLimit
IF Array[Counter] > MaximumValue
THEN
MaximumValue ← Array[Counter]
ENDIF

IF Array[Counter] < MinimumValue


THEN
MinimumValue ← Array[Counter]
ENDIF
NEXT Counter

// Average//

2.2. Standard methods used in Total ← 0


FOR Counter ← 1 TO NumberOfValues
algorithm: Total ← Total + StudentMark[Counter]
NEXT Counter
Totalling :Totalling means keeping a total that values are Average ← Total / NumberOfValues
added to
Linear Search: In a linear search, each item in the list is
Total ← 0 inspected sequentially until a match is found or the
FOR Counter ← 1 TO LoopLimit entire list is traversed.
Total ← Total + ValueToBeTotalled
NEXT Counter
INPUT Value
Counting: Keeping a count of the number of times an Found ← FALSE
action is performed is another standard method. Counter ← 0
REPEAT
PassCount ← 0
IF Value = Array[Counter]
FOR Counter ← 1 TO LoopLimit
THEN
INPUT Value
Found ← TRUE
IF Value > Range ELSE
THEN Counter ← Counter + 1
PassCount ← PassCount + 1
ENDIF
ENDIF
UNTIL Found OR Counter > NumberOfValues
NEXT Counter IF Found
THEN
Maximum, minimum and average : Finding the largest
OUTPUT Value , " found at position " , Counter, "
and smallest values in a list are two standard methods
ELSE
that are frequently found in algorithms
OUTPUT Value , " not found."
ENDIF

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

Bubble Sort: Iteratively compare and swap adjacent


elements in a list to sort them. Start from the first 3.3. Extreme Data
element and continue until the second-to-last element.
After each pass, the last element is in its correct place. Extreme data are the largest and smallest values that
normal data can take
However, other elements may still be unsorted. Repeat
e.g. in a program where only whole number values
the process, excluding the last element, until only one
element remains or no swaps are needed. ranging from 0 to 100 (inclusive) are accepted, extreme
data will be: 0 and 100
First ← 1
Last ← 10 3.4. Boundary Data
REPEAT
Swap ← FALSE This is used to establish where the largest and smallest
FOR Index ← First TO Last - 1 values occur
IF Array[Index] > Array[Index + 1] At each boundary two values are required: one value is
THEN accepted and the other value is rejected.
Temp ← Array[Index] e.g. in a program where only whole number values
Array[Index] ← Array[Index + 1] ranging from 0 to 100 (inclusive) are accepted, one
Array[Index + 1] ← Temp example of boundary data will be: 100 and 101. 100 will
Swap ← TRUE be accepted and 101 will not be accepted
ENDIF
NEXT Index
Last ← Last - 1 4. Trace Table
UNTIL (NOT Swap) OR Last = 1
A trace table is utilized to document the outcomes of
3. Test Data every step in an algorithm. It is employed to record the
variable's value each time it undergoes a change.
A dry run refers to the manual process of systematically
Test data refers to input values used to evaluate and executing an algorithm by following each step in
assess the functionality and performance of a computer sequence.
program or system. A trace table is set up with a column for each variable
It helps identify errors and assess how the program and a column for any output e.g.
handles different scenarios

3.1. Normal Data


Normal data is the test data which accepts values in
acceptible range of values of the program
Normal data should be used to work through the
solution to find the actual result(s) and see if they are the Test data is employed to execute a dry run of the flowchart
same as the expected result(s) and document the outcomes in a trace table. During the dry
e.g. in a program where only whole number values run:
ranging from 0 to 100 (inclusive) are accepted, normal
test data will be : 23, 54, 64 , 2 and 100 Whenever a variable's value changes, the new value is
recorded in the respective column of the trace table.
3.2. Abnormal Data Each time a value is outputted, it is displayed in the
output column.
Test data that would be rejected by the solution as not
An example of trace table is given below using a past paper
suitable, if the solution is working properly is called
question:
abnormal test data / erroneous test data. Q: The flowchart below inputs the height of children who
e.g. in a program where only whole number values want to ride on a rollercoaster. Children under 1.2 metres
ranging from 0 to 100 (inclusive) are accepted, abnormal are rejected. The ride starts when eight children have been
data will be: -1, 151, 200, 67.2, “Sixty-Two” and -520
accepted.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

1. Make sure that the problem is clearly understood


which includes knowing the purpose of the algorithm
and the tasks to be completed by the algorithm.
2. Break the problem into smaller problems (e.g. in a
program which outputs average values, divide the
problem into multiple ones i.e. how to count the
number of iterations and how to count the total of all
values)
3. Identify the data that is needed to be saved into
variables/constants/arrays and what datatype it is,
and declare all the variables/constants/arrays
accordingly, with meaningfull names
Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3, 4. Decide on how you are going to construct your
1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0 algorithm, either using a flowchart or pseudocode. If
Riders Reject Height OUTPUT
you are told how to construct your algorithm, then
follow the guidance.
0 0
5. Construct your algorithm, making sure that it can be
1 1.4
easily read and understood by someone else. Take
2 1.3
particular care with syntax e.g. when conditions are
1 1.1 used for loops and selection.
3 1.3 6. Use several sets of test data (Normal, Abnormal and
2 1.0 Boundary) to dry run your algorithm and check if the
4 1.5 expected results are achieved (a trace table can be
3 1.2 used for this purpose) . If error is found, find the
5 1.3 point of error in the trace table and fix it in the code.
6 1.4
7 1.3 Note: The algorithms that you have looked at so far in these
4 0.9
notes were not designed with readability in mind because
you needed to work out what the problem being solved was.
8 1.5 Ready to go 4

4.1. Identifying errors: 5.1. Validation and Verification


To ensure the acceptance of reasonable and accurate data
Trace tables can be used to trace errors in a program.
inputs, computer systems must thoroughly examine each
For example, if the requirement for the previous
data item before accepting it, and this is where Validation
question would be to accept riders that are of height 1.2
and Verification come into play!
too, rather than rejecting them, then the error would
have been caught in the trace table as when 1.2 is Validation
entered, it would increment rejected which it shouldn’t in
our example Validation in computer systems involves automated checks
to ensure the reasonableness of data before accepting it. If
5. How to write an algorithm? the data is invalid, the system should provide an explanatory
message for rejection and allow another chance to enter the
data.
The ability to write an algorithm is very important for \n There are many types of it.
this syllabus and paper. Some key steps/points to be
known in-order to write the perfect algorithm are as Range check
follows:
A range check verifies that a numerical value falls within
specified upper and lower limits.

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE COMPUTER SCIENCE

REPEAT OUTPUT "Please enter the value "


INPUT Value REPEAT
IF Value < MinimumValue OR Value > MaximumValue INPUT Value
THEN IF Value = ""
OUTPUT "The student's mark should be in the range" THEN
ENDIF OUTPUT "*=Required "
UNTIL Value >= MinimumValue AND Value <= MaximumValu ENDIF
UNTIL Value <> ""
Length check
Format Check
This can either ensure that data consists of a precise
number of characters. A format check checks that the characters entered conform
to a pre-defined pattern.
OUTPUT "Please enter your value of ", Limit , " cha
REPEAT Check Digit
INPUT Value
IF LENGTH(Value) <> Limit A check digit is the final digit included in a code; it is
THEN calculated from all the other digits.
OUTPUT "Your value must be exactly" , Limit ," cha Check digits are used for barcodes, product codes,
ENDIF International Standard Book Numbers (ISBN), and
UNTIL LENGTH(Value) = Limit Vehicle Identification Numbers (VIN).
It can also check if the data entered is a reasonable number Verification
of characters or not
OUTPUT "Please enter your value "
Verification is checking that data has been accurately copied
REPEAT
from one source to another
There are 2 methods to verify data during entry ( there
INPUT Value
are other methods during data transfer, but they are in
IF LENGTH(Value) > UpperLimit OR LENGTH(Value) < Lo
paper 1)
THEN
OUTPUT "Too short or too long, please re-enter "
ENDIF
1. Double Entry
UNTIL LENGTH(Value) <= UpperLimit AND LENGTH(Value) Data is inputted twice, potentially by different operators.
The computer system compares both entries and if they
Type check differ, an error message is displayed, prompting the data
to be reentered.
A type check verifies that the entered data corresponds to a
specific data type.
2. Screen/Visual check
OUTPUT "Enter the value "
REPEAT
A screen/visual check involves the user manually
INPUT Value reviewing the entered data.
IF Value <> DIV(Value, 1)
After data entry, the system displays the data on the
THEN screen and prompts the user to confirm its accuracy
OUTPUT "This must be a whole number, please re-en before proceeding.
ENDIF The user can compare the displayed data against a paper
UNTIL Value = DIV(Value, 1)
document used as an input form or rely on their own
knowledge to verify correctness.
Presence check
A presence check checks to ensure that some data has been
entered and the value has not been left blank

WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by Raymond Catarata at Vinschool on 09/11/24.
CAIE IGCSE
Computer Science

© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by Raymond Catarata on Sat Nov 09 2024 for strictly personal use only.
These notes have been created by Abdullah Aamir, Abhiram Mydi and Shriram Srinivas for the 2023-2025 syllabus.
The document contains images and excerpts of text from educational resources available on the internet and printed books.
If you are the owner of such media, test or visual, utilized in this document and do not accept its usage then we urge you to contact us
and we would immediately replace said media. No part of this document may be copied or re-uploaded to another website.
Under no conditions may this document be distributed under the name of false author(s) or sold for financial gain.
"ZNotes" and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).

You might also like