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를 최신 버전으로 업데이트해 주세요.
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.
DECLARE Name : STRING
DECLARE Done : BOOLEAN
DECLARE Birth : DATE
Name ← "Ada"
Done ← TRUE
OUTPUT Name
OUTPUT Done
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 PassMark = 50
OUTPUT PassMark
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.
Common mistakes
BOOLEANvalues areTRUEandFALSE, in capitals.- A
CHARis one character in single quotes, such as'A'. ASTRINGuses double quotes.
Now you try
- Declare a constant with
=and output it. - Text needs quotes:
"Ada", notAda.
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. · 출력을 보려면 '실행'을 클릭하세요.