





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Comprehensive, high-quality study notes for the Cambridge International curriculum. Target Qualification: [ IGCSE] Subject Name: [computer science] Syllabus Code: [0478] What is included in this document: • Complete breakdown of [Topic:programming] matching the official CAIE learning objectives. • Clearly explained definitions, key- diagrams • Step-by-step worked examples to show how to answer typical exam questions. • Clean, scannable layout designed for quick revision right before midterms or final board exams. Perfect for students aiming for an A* who want a clear summary without reading dense textbook pages!
Typology: Summaries
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























5 Basic (^) Constructs for (^) Developing a program ① Data^ Usage :^ Variable^ ,^ Constant^ , Arrays ②Sequence :^ Order of steps^ in (^) a task INPUT Age (^) Input It Age
conditiona ③ Selection^ : Choosing a path (^) through the program ⑦ (^) Iteration : Repetition (^) of a sequence of^ steps^ in (^) a Program ⑤ (^) Operator Usage : Arthmetic^ for calculation, Logical
statements (^) for decision^ making
③ String
aba double -single ④ Char^
⑤ Boolean^
two values (^) (Yes/No (^) , ONOFF (^) , True/False DECLARATION In part X Product xX
Datatype DECLARE Sum^ :^ INTEGER Declare ↓ Sum =^ o^ -^ Initialisation^ Initialise
CONSTANT Pi^ =^3.^142
many
a specific string
DECLARE Name^ :^ STRING DECLARE LenName^ :^ INTEGER INPUT Name 1/ Length check LenName = (^) LENGTH) (^) Name)
incorrect ② (^) Uppercase =>^ UCASE^ (Vamable)^ can only wood i
UpperSentence = (^) UCASE (^) (Sentence) memory b
Uppe
Repeat
Input X Until XPassword^ - separate ~ (^) CASEXnput) ③ Lowes^ Case^ => LCASE^ (Vamable) LCASE (^) ("HELLO") =^ hello INPUT Paragraph Updated - CASE^ (Paragraph)
intgen
nee LIBRARY ROUTINES L ① DIV->^ Divides^ a number^ by a^ value^ String
goutient 4 =^ Contient 54 20
you
↓ 4 DECLARE Quotient (^) : (^) INTEGER
OUTPUT (^) Quatient
② MOD^ =>^ Returns^ the^ remainder^ of a specific
being divided by a^ number Remainder
↓ ③ ROUND (^) (Value (^) , Precision) 35
. 9 ↓ value =^ ROUND (^) (102 ·^578 , 2)^ o
Num =^ ROUND / Num^ , (^) 3) ROUND (102.^578 , 2) ↓ 102.^6
① (^) RANDOM (^) () 103 Real
Scores Assign (^) poss value (^) to a^ variable 23 5
s (^90) & 97 2 &
to 36 5 Change value of post^ to (^301) Assigning Value (^) to on Array Scores (^) [1] =^30 · Decleration of (^) Array :
ArrayName : ARRAY^ (Starting , Ending]
Datatype
column ↓ (^) Marks Lexecute 50 95 =^ rows I
-- n^ row^ =^50
Array ·
1 Column^ St 5
&^ empty
Populating the Array / Filling on Array
Marks(2] =^50 -^ This^ is &^ very^ inefficient Marks (^) [so] =^45 Marks(Count] Array Name (^) [Position] FOR (^) Count <1 TO (^50) Count
INPUT (^) Marks Marks LE]^ =^50 Marks [Count]^ <^ Marks Count = 50 as NEXT Count
Increments (^) the I (^) automatically Only if
question does (^) not specify the^ array size ARRAY (^21) ,^5003 //^ Assuming
of elements are 100
Al (^) OUTPUTTING DATA * Mary am (^6)
j
Y
OUTPUT Names (^) [Position] Mustafa 3
1 error to
8 (^1) Repeat
=>+^1 error
OUTPUT "Please^ enter a^ name"
[1 , (^) 5]
UNTILCount > 10
Names (^) [Count] = Name
ENDWHILE
= > -^ - => -
FOR (^) Count=^1 To (^10)
II INPUTNHey^ Num
FOR Counter^ =^
not (^) equal IF (^) CheckNumber > (^) Names [Counter]
"
" CheckNumber^ , " Array Value" , Names (^) [Counter] , (^) "They do not^ match.^ Recenter
INDUT Names^ [Counter]
NEXT (^) Counter
completed" To ensure that you keep
specified conditions one INPUT Names (^) [Counter]
CoLl CoL ↓ (^) ↓ 2D
CoL (^) Num 1 CoL^ NumI
RowNum (^) - #^ -
O) Initialise^ a^ 2D^ Array that^ asks^ the^ user for Marks^. Suppose
already initialised Class (^) Siz= 35 COLO^ CoL 1 marks I notrequired for this (^) question Star! · (^) = 2 cols (^) I (^2) DECLARE Marks^ :^ ARRAY^10 :^34 , 01]^ OF^ INTEGER 2 3 ↓ (^) Y (^35) rows h 5
OUTPUT "enter^ marks^ for
" ,
Marks (^) [RowNumber (^) , 1] (^) ID 40
MAX (^0) Is 3 Go
FORRCount =^1 TO (^50)
IF (^) StudentMarks [RCount (^) , 2] >^ MAX THEN Max=^ StudentMarks[RCount, 2] ID = StudentMarks [RCount (^) , 1) ENDIF NEXT RCount OUTPUT "the student^ with^ highest
of : " , ID^ , "and the highest marks (^) are : " , Max Linear (^) Search Names []
array has the^ name^ "Annas"^ in^ it^ or Alezah (^1) not Annus^2 Samraj
FOR (^) Count 10 TO^3
> Secon
THEN (^) OUTPUT (^) "person found" -
Q) There^ is^ an^ ID array
names of
got
a program That (^) takes a (^) name (^) as on input from^
and (^) check whether the (^) name exists (^) in the array
(Count >^ 150)
THEN (^) OUTPUT (^) "person (^) found" ELSE
found" ENDIF Bubble Arrange-^ Ascending (Descending (^1) , 8
↓ (^) Algorithm
, 12 = (^) Ordered
& S I (^) ,^ "^ , (^12) , 3 Q^ n=^5 ENDING
184 , (^12) , 32 ↓^3 ->^ Q 1 , (^4) , 8 , 12 ,^38 For^ are iteration^ out of
I (^) , (^4) , (^8) , 12 , (^3 5) , one value^ is being sorted
#^4 ,^8 ,^3 ,^12 -^ > Largest
sorted (^1) , 4 , 8 ,^3 ,^12 = " = (^1) , (^4) , 8 , 3 , 12 1 ,^4 , (^8) ,^3 , 12 (^1) , (^4) ,^8 , 12 -^3 ,^8 , 2 are (^) sorted perfectly
(^1) , 4,3 , (^8) , 12 ① My > ② (^1) , (^) 4 3 , (^8) , 12 l (^) D, (^4) , (^8) , 12 ③^ -^ >^ Sorted^ Array
=> 1 , (^3) ,^4 , (^8) ,^12 T T, (^3) , (^4) , 8 , 12 At^ a = ↑ 1 sorted^2 2
a =^3 au tempe a b = 3 at^ b HOW (^) DOES IT SORT b a^ b^ < temp Values (^) [1] (^) < 6 ⑥, (^4) , 3 ,^9 ,^11 , 1 Values (^) [2] 4 Vanished a b^ ( values [1] = Values^ (2]^4 , (^4) , (^3) , 9 , (^11) , 1
Gerror (^) Value (2)
(^4) , 3 , 9 , 1. 1 T (^) w values (^) (
Temp =^ Values^ [1] 3 3 ,Bali !
Swapping (^3) , (^4) , 9 , (^4) , 1
Temp TIP : Sorting always^ includes^ the temporary variable