Putting it together · Tout mettre ensemble
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
English
One program uses several constructs
- A 9618 answer mixes
DECLARE,←,IF…THEN,FORandOUTPUT. - Indent the body of a loop. Put
THENon theIFline. - A short comment with
//says what a block is for.
Français
Un programme utilise plusieurs constructions
- Une réponse 9618 mélange
DECLARE,←,IF…THEN,FORetOUTPUT. - Indentez le corps d'une boucle. Mettez
THENsur la ligneIF. - Un court commentaire avec
//explique ce qu'un bloc fait.
// Total the five marks, then say whether the total reaches 20.
DECLARE Mark : ARRAY[1:5] OF INTEGER
Mark[1] ← 4
Mark[2] ← 8
Mark[3] ← 6
Mark[4] ← 2
Mark[5] ← 5
DECLARE Total : INTEGER
Total ← 0
FOR I ← 1 TO 5
Total ← Total + Mark[I]
NEXT I
OUTPUT "Total = ", Total
IF Total >= 20 THEN
OUTPUT "target met"
ELSE
OUTPUT "below target"
ENDIF
English
What this course left for A2
- Random files, classes, enumerated types and pointers are in the full 9618 guide.
- They are assessed at A2, not in this AS course.
- The IGCSE course on this site uses the 0478 rules for 2026–2028. Do not copy those into a 9618 answer.
Français
Ce que ce cours a réservé au programme A2
- Les fichiers aléatoires, les classes, les types énumérés et les pointeurs figurent dans le guide complet 9618.
- Ils sont évalués au niveau A2, pas dans ce cours AS.
- Le cours IGCSE sur ce site utilise les règles 0478 pour 2026–2028. Ne copiez pas celles-ci dans une réponse 9618.
English
Now you try
- Total an array, then choose a message with
IF.
Français
À vous maintenant
- Additionner un tableau, puis choisir un message avec
IF.
The array is filled for you. Output Total = 25 on one line, then target met because 25 is at least 20. · Le tableau est rempli pour vous. Affichez Total = 25 sur une ligne, puis target met car 25 est supérieur ou égal à 20.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.