Types and constants · 型と定数
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
English
Six data types
- The 2026 guide uses
INTEGER,REAL,CHAR,STRING,BOOLEANandDATE. DATEis in this guide. It is not in the IGCSE 0478 syllabus for 2026–2028.- A paper that uses a date tells you the format, because dates are written differently around the world.
日本語
6つのデータ型
- 2026年のガイドでは、
INTEGER、REAL、CHAR、STRING、BOOLEAN、DATEを使用します。 DATEはこのガイドに含まれますが、IGCSE 0478 2026–2028年度カリキュラムには含まれていません。- 日付を含む問題紙がある場合、日付の表記法は国によって異なるため、指定されたフォーマットに従う必要があります。
DECLARE Name : STRING
DECLARE Done : BOOLEAN
DECLARE Birth : DATE
Name ← "Ada"
Done ← TRUE
OUTPUT Name
OUTPUT Done
English
CONSTANT uses =
- A constant is a name for a value that the program does not change.
- The guide writes
CONSTANT HourlyRate = 6.50— with=, not with the arrow. - Only a literal may stand on the right: a number, or text in quotes.
日本語
CONSTANT uses =
- 定数(Constant) とは、プログラムが変更しない値に対する名前です。
- ガイドでは
CONSTANT HourlyRate = 6.50—— 矢印ではなく、=を用いて書きます。 - 右側にはリテラルのみを置きます: 数値か、二重引用符で囲まれたテキスト。
CONSTANT PassMark = 50
OUTPUT PassMark
English
Watch out
- Variables are stored with
←. Constants are declared with=. - The guide's own date example is written
02/01/2005. On the paper, follow the format the question gives you.
日本語
注意
- 変数は
←で格納されます。定数は=で宣言されます。 - ガイドの日付の例は
02/01/2005と書かれています。問題紙では、設問で与えられたフォーマットに従ってください。
English
Common mistakes
BOOLEANvalues areTRUEandFALSE, in capitals.- A
CHARis one character in single quotes, such as'A'. ASTRINGuses double quotes.
日本語
よくあるミス
BOOLEANの値はTRUEとFALSEで、大文字で表します。CHARは単一引用符で囲まれた1文字です(例:'A')。STRINGは二重引用符を使用します。
English
Now you try
- Declare a constant with
=and output it. - Text needs quotes:
"Ada", notAda.
日本語
あなたも試してみよう
=で定数を宣言して出力します。- テキストには引用符が必要です:
"Ada"、Adaではありません。
Declare a constant PassMark equal to 50 and output it. Fill in the value on the CONSTANT line. · 定数PassMarkを50に設定して出力します。CONSTANT行に値を入力してください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
Output the word Ada in quotes, so the program prints Ada. · 文字列Adaを引用符で囲んで出力し、プログラムがAdaを印刷するようにします。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
Declare Name as a STRING, store Ada, and output it. · NameをSTRINGとして宣言し、Adaを格納して出力します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。