Programming concepts — data and control structures · Concepts de programmation — structures de données et de contrôle
| English | Français |
|---|---|
| variable/ˈveərɪəbl/ | variable |
| constant/ˈkɒnstənt/ | constante |
| data type/ˈdeɪtə taɪp/ | type de donnée |
| integer/ˈɪntɪdʒə/ | entier |
| real/rɪəl/ | réel |
| string/strɪŋ/ | chaîne |
| Boolean/ˈbuːlɪən/ | Boolean |
| sequence/ˈsiːkwəns/ | séquence |
| selection/sɪˈlekʃn/ | naturelle |
| iteration/ˌɪtəˈreɪʃn/ | itération |
Programming building blocks
- Programs store data in variables 变量 and constants 常量, each with a data type 数据类型.
- They are built from three control structures.
- We finish with the totalling and counting patterns.
Blocs de construction de programmation
- Les programmes stockent les données dans des variables 变量 et des constantes 常量, chacun avec un type de données 数据类型.
- Ils sont construits à partir de trois structures de contrôle.
- Nous terminons avec les modèles de sommes et de comptages.
Variables, constants and data types
- A variable can change; a constant is fixed. Declare both before use.
- Five basic data types: integer 整数 (whole number), real 实数 (decimal), char (one character), string 字符串 (text), Boolean 布尔值 (
TRUE/FALSE).
The three control structures: sequence 顺序 runs steps in order, selection 选择 chooses a branch, iteration 迭代 repeats a body.
Variables, constantes et types de données
- Une variable peut changer ; une constante est fixe. Déclarez les deux avant utilisation.
- Cinq types de données de base : integer 整数 (nombre entier), real 实数 (décimal), char (un caractère), string 字符串 (texte), Boolean 布尔值 (
TRUE/FALSE).
DECLARE Score : INTEGER
CONSTANT Pi ← 3.142

Les trois structures de contrôle : la séquence 顺序 exécute les étapes dans l'ordre, la sélection 选择 choisit une branche, l'itération 迭代 répète un corps.
What is the difference between a variable and a constant? · Quelle est la différence entre une variable et une constante ?
A variable's value can change; a constant is set once and never changes. · La valeur d'une variable peut changer ; une constante est définie une seule fois et ne change jamais.
Match each value to its data type. · Reliez chaque valeur à son type de donnée.
Whole number = integer; decimal = real; text in quotes = string (a single char like 'A' is char). · Nombre entier = entier ; décimal = réel ; texte entre guillemets = chaîne (un seul caractère comme 'A' est un caractère).
Sequence and selection
- Sequence — steps run one after another, top to bottom.
- Selection — choose which steps run, with
IF…ELSE(orCASEfor many options):
Variables and constants are named stores for values, set in the program's code.
Séquence et sélection
- Séquence — les étapes s'exécutent l'une après l'autre, de haut en bas.
- Sélection — choisissez quelles étapes s'exécutent, avec
IF…ELSE(ouCASEpour plusieurs options) :
IF Score >= 50
THEN
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
ENDIF

Les variables et constantes sont des espaces nommés pour stocker des valeurs, définis dans le code du programme.
How an IF … ELSE IF ladder decides · Comment une structure IF … ELSE IF décide
The conditions are tested top to bottom; the FIRST one that is true runs and the rest are skipped. Slide the score and watch which branch lights up. · Les conditions sont testées de haut en bas ; la PREMIÈRE qui est vraie s'exécute et les autres sont ignorées. Faites glisser la note et regardez quelle branche s'allume.
Which structure chooses which steps to run based on a condition? · Quelle structure choisit quelles étapes exécuter selon une condition ?
Selection branches on a condition; sequence runs in order; iteration repeats. · La sélection branchement selon une condition ; la séquence s'exécute dans l'ordre ; l'itération répète.
Iteration and totalling
- Count-controlled (
FOR) repeats a fixed number of times. - Pre-condition (
WHILE) tests before — may run zero times. Post-condition (REPEAT…UNTIL) tests after — runs at least once. - Totalling:
Total ← Total + Value; counting:Count ← Count + 1.
While a program runs, its variables are held in the computer's memory (RAM).
Itération et totalisation
- Compteur contrôlé (
FOR) répète un nombre fixe de fois. - Pré-condition (
WHILE) teste avant — peut s'exécuter zéro fois. Post-condition (REPEAT…UNTIL) teste après — s'exécute au moins une fois. - Totalisation :
Total ← Total + Value; comptage :Count ← Count + 1.

Pendant l'exécution d'un programme, ses variables sont stockées dans la mémoire de l'ordinateur (RAM).
A WHILE loop tests its condition before the body (so it may run zero times), while a REPEAT...UNTIL loop tests after the body (so it always runs at least once). · Une boucle WHILE teste sa condition avant le corps (elle peut donc ne s'exécuter zéro fois), tandis qu'une boucle REPEAT...UNTIL teste après le corps (elle s'exécute donc au moins une fois).
Pre-condition (WHILE) can skip entirely; post-condition (REPEAT) always runs once — choose by whether the body must run at least once. · Précondition (WHILE) peut sauter entièrement ; postcondition (REPEAT) s'exécute toujours une fois — choisissez selon si le corps doit s'exécuter au moins une fois.
You've got it
- variable changes, constant is fixed; types: integer, real, char, string, Boolean
- three structures: sequence, selection (IF/CASE), iteration (FOR/WHILE/REPEAT)
- WHILE tests before (0+ times); REPEAT tests after (1+ times)
- totalling = running total; counting = add 1 each time
Vous avez compris
- variable change, constante est fixe ; types : integer, real, char, string, Boolean
- trois structures : séquence, sélection (IF/CASE), itération (FOR/WHILE/REPEAT)
- WHILE teste avant (0+ fois) ; REPEAT teste après (1+ fois)
- totalisation = total accumulé ; comptage = ajouter 1 à chaque fois
Which line keeps a running total? · Quelle ligne maintient un total cumulé ?
total ← total + value accumulates the sum; count ← count + 1 counts occurrences. · total ← total + value accumule la somme ; count ← count + 1 compte des occurrences.