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.
العربية
ستة أنواع للبيانات
- يستخدم الدليل لعام 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 تستخدم =
- الثابت هو اسم لقيمة لا يغيرها البرنامج.
- يكتب الدليل
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هو حرف واحد بين علامات اقتباس مفردة، مثل'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. · اضغط تشغيل لرؤية المخرجات هنا.