| English | 意味 |
|---|---|
| variable/ˈveərɪəbl/ | 変数 |
| constant/ˈkɒnstənt/ | 定数 |
| data type/ˈdeɪtə taɪp/ | データ型 |
| integer/ˈɪntɪdʒə/ | 整数 |
| real/rɪəl/ | 実数 |
| string/strɪŋ/ | 文字列 |
| Boolean/ˈbuːlɪən/ | ブール値 |
| sequence/ˈsiːkwəns/ | 順序 |
| selection/sɪˈlekʃn/ | 選択 |
| iteration/ˌɪtəˈreɪʃn/ | 反復 |
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.
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).
DECLARE Score : INTEGER
CONSTANT Pi ← 3.142

The three control structures: sequence 顺序 runs steps in order, selection 选择 chooses a branch, iteration 迭代 repeats a body.
変数と定数の違いは何か?
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
変数の値は変わる可能があり、定数は一度設定され、その後変わらない。
それぞれの値とそのデータ型を結びつけてください。
難易度 2/5 · 140 コイン + 今日初回完了時に小ボーナス付与
整数 = 整数型;実数 = 小数型;引用符内のテキスト = ストリング('A' のような単一文字は char)。
Sequence and selection
- Sequence — steps run one after another, top to bottom.
- Selection — choose which steps run, with
IF…ELSE(orCASEfor many options):
IF Score >= 50
THEN
OUTPUT "Pass"
ELSE
OUTPUT "Fail"
ENDIF

Variables and constants are named stores for values, set in the program's code.
IF … ELSE IF ラダーがどのように決定するか
条件は上から下へテストされ、最初の真(true)となった条件が実行され、残りはスキップされる。スコアをスライドして、どの分岐が点灯するか観察せよ。
条件に基づいてどのステップを実行するか選択する構造はどれか?
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
選択構造は条件によって分岐し、シーケンスは順に実行され、反復は繰り返す。
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).
WHILEループは本体実行前に条件を検査するため(ゼロ回実行される可能性がある)、REPEAT...UNTILループは本体実行後に条件を検査するため(必ず一度以上実行される)。
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
前提条件(WHILE)は完全にスキップされる可能性があり、後置条件(REPEAT)は必ず一度実行されるため、本体が少なくとも一度実行されなければならないかどうかによって選択する。
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
どの行がrunning total を維持しているか?
難易度 1/5 · 100 コイン + 今日初回完了時に小ボーナス付与
total ← total + value は和を蓄積します;count ← count + 1 は出現回数を数えます。