Types and constants · Tipe dan konstanta
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Halaman ini memerlukan browser terbaru (dengan dukungan SharedArrayBuffer). Silakan perbarui Chrome, Edge, Firefox, atau Safari ke versi terbaru.
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.
Bahasa Indonesia
Enam tipe data
- Panduan 2026 menggunakan
INTEGER,REAL,CHAR,STRING,BOOLEANdanDATE. DATEada dalam panduan ini. Ia tidak ada dalam silabus IGCSE 0478 untuk 2026–2028.- Sebuah soal yang menggunakan tanggal memberi tahu formatnya, karena tanggal ditulis berbeda di seluruh dunia.
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.
Bahasa Indonesia
CONSTANT menggunakan =
- Konstanta adalah nama untuk nilai yang tidak diubah oleh program.
- Panduan menulis
CONSTANT HourlyRate = 6.50— dengan=, bukan dengan tanda panah. - Hanya literal yang boleh berada di sebelah kanan: angka, atau teks dalam tanda kutip.
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.
Bahasa Indonesia
Hati-hati
- Variabel disimpan dengan
←. Konstanta dideklarasikan dengan=. - Contoh tanggal panduan itu sendiri ditulis
02/01/2005. Di atas kertas, ikuti format yang diberikan soal.
English
Common mistakes
BOOLEANvalues areTRUEandFALSE, in capitals.- A
CHARis one character in single quotes, such as'A'. ASTRINGuses double quotes.
Bahasa Indonesia
Kesalahan umum
- Nilai
BOOLEANadalahTRUEdanFALSE, dalam huruf kapital. - Sebuah
CHARadalah satu karakter dalam tanda petik tunggal, seperti'A'. SebuahSTRINGmenggunakan tanda petik ganda.
English
Now you try
- Declare a constant with
=and output it. - Text needs quotes:
"Ada", notAda.
Bahasa Indonesia
Sekarang Anda coba
- Deklarasikan konstanta dengan
=dan tampilkan. - Teks butuh tanda kutip:
"Ada", bukanAda.
Declare a constant PassMark equal to 50 and output it. Fill in the value on the CONSTANT line. · Deklarasikan konstanta PassMark sama dengan 50 dan outputkan. Isi nilainya pada baris CONSTANT.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.
Output the word Ada in quotes, so the program prints Ada. · Outputkan kata Ada dalam tanda kutip, agar program mencetak Ada.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.
Declare Name as a STRING, store Ada, and output it. · Deklarasikan Name sebagai STRING, simpan Ada, dan outputkan.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.