(d) Understand and use the concepts of totalling and counting
(e) Understand and use the concept of string handling
• Including: – length – substring – upper – lower • The first character of the string can be position zero or one
(f) Understand and use arithmetic, relational and logical operators
• Arithmetic, limited to: – + – – – / – * – ^ (raised to power of) – MOD – DIV • Relational, limited to: – = – < – <= – > – >= – <> (not equal to) • Logical, limited to: – AND – OR – NOT
5 Understand and use nested statements
• Including nested selection and iteration • Candidates will not be required to write more than three levels of nested statements
6 (a) Understand what is meant by procedures, functions and parameters (b) Define and use procedures and functions, with or without parameters (c) Understand and use local and global variables
• Procedures and functions may have up to three parameters
7 Understand and use library routines
• Including: – MOD – DIV – ROUND – RANDOM
8 Understand how to create a maintainable program
• Including appropriate use of: – meaningful identifiers – the commenting feature provided by the programming language – procedures and functions – relevant and appropriate commenting of syntax • Use meaningful identifiers for: – variables – constants – arrays – procedures and functions
العربية
يجب أن يكون المرشحون قادرين على:
ملاحظات وإرشادات
1 أعْلن واستخدم المتغيرات والثوابت
2 افهم واستخدم أنواع البيانات الأساسية
• يشمل: – عدد صحيح – عدد حقيقي – حرف – سلسلة نصية – منطقية
• يشمل: – الطول – الجزء الجزئي – أحرف كبيرة – أحرف صغيرة • يمكن أن يكون أول حرف في السلسلة عند الموقع صفر أو واحد
(و) افهم واستخدم العمليات الحسابية والعلاقية والمنطقية
• الحسابية، مقيدة بـ: – + – – – / – * – ^ (مرفوعة لأس) – MOD – DIV • العلاقية، مقيدة بـ: – = – < – <= – > – >= – <> (غير مساوية) • المنطقية، مقيدة بـ: – AND – OR – NOT
5 افهم واستخدم الجمل المتداخلة
• يشمل الجمل المختارة والمتداخلة والحلقات المتداخلة • لن يُطلب من المترشحين كتابة أكثر من ثلاث مستويات من الجمل المتداخلة
6 (أ) افهم ما يُقصَد بـالجراءات والدوال والمعلمات (ب) عرّف واستخدم الإجراءات والدوال، مع أو بدون معلمات (ج) افهم واستخدم المتغيرات المحلية والعالمية
• قد تحتوي الإجراءات والدوال على ما يصل إلى ثلاثة معلمات
7 افهم واستخدم الروتين المكتبي
• يشمل: – MOD – DIV – ROUND – RANDOM
8 افهم كيفية إنشاء برنامج قابل للصيانة
• بما في ذلك الاستخدام المناسب لـ: – المعرّفات ذات المعنى – ميزة التعليق التي يوفرها لغة البرمجة – الإجراءات والدوال – التعليق المناسب والمعني على بناء الجملة • استخدم معرّفات ذات معنى لـ: – المتغيرات – الثوابت – المصفوفات – الإجراءات والدوال
Source: Cambridge International syllabus · المصدر: منهج كامبريدج الدولي
English
A variable 变量 is a named store that holds a value which can change while the program runs. A constant 常量 is a named store whose value is fixed and does not change.
You should declare 声明 them (say their name and type) before use:
Use a constant for a value that never changes (like Pi), so it is set in one place and is easy to read.
العربية
المتغير هو مستودع مُسمى يحمل قيمة يمكن تغييرها أثناء تشغيل البرنامج. الثابت هو مستودع مُسمى قيمته ثابتة ولا تتغير.
المتغير هو مخزن مسمّى يمكن أن تتغير قيمتهالمتغيرات والثوابت هي مستودعات مُسمية للقيم، تُحدد في كود البرنامج
يجب عليك إعلان them (ذكر اسمها ونوعها) قبل الاستخدام:
DECLARE Score : INTEGER
DECLARE Name : STRING
CONSTANT Pi ← 3.142
أثناء تشغيل البرنامج، تُحفظ متغيراته في ذاكرة الكمبيوتر (RAM)
استخدم ثابتاً لقيمة لا تتغير أبداً (مثل Pi)، بحيث تُحدد في مكان واحد وسهلة القراءة.
Explore · استكشف
Variables and assignment
Step through the lines and watch each variable take its new value.
totalling 求和 — keep adding values to a running total: Total ← Total + Value.
counting 计数 — add 1 to a counter each time: Count ← Count + 1.
Worked example. A program must read 5 marks, then output the total and the average.
Two lines carry the marks. Total ← 0 must sit before the loop: put it inside and the total resets on every pass, so the program outputs only the last mark. And Average ← Total / 5 must sit after the loop, because the total is not complete until every mark has been added. Initialise before, calculate after - that ordering is what the question is really testing.
العربية
الجمع العودي — استمر في إضافة القيم إلى مجموع متراكم: Total ← Total + Value.
العد — أضف 1 إلى عداد كل مرة: Count ← Count + 1.
عداد يعد تصاعدياً بمقدار 1؛ المجموع يبني مجموعاً تراكمياً
*جدول التتبع يتتبع حلقة الجمع العودي والعد خطوة بخطوة
Total ← 0
FOR I ← 1 TO 10
INPUT Mark
Total ← Total + Mark
NEXT I
OUTPUT Total
مثال محلول. يجب على برنامج قراءة 5 درجات، ثم إخراج المجموع والمتوسط.
Total ← 0
FOR I ← 1 TO 5
INPUT Mark
Total ← Total + Mark
NEXT I
Average ← Total / 5
OUTPUT Total, Average
سطران يحملان الدرجات. Total ← 0 يجب أن يكون قبل الحلقة: ضعها داخلها وسيعيد المجموع تعيينه في كل مرور، لذا سيعرض البرنامج الدرجة الأخيرة فقط. وAverage ← Total / 5 يجب أن يكون بعد الحلقة، لأن المجموع غير مكتمل حتى يتم إضافة كل الدرجات. التهيئة قبل الحساب بعد - هذا الترتيب هو ما يختبره السؤال حقًا.
(قد يُحسب أول حرف كموضع 0 أو موضع 1، اعتمادًا على اللغة.)
Explore · استكشف
SUBSTRING: take part of a string
The first character is at position 1. SUBSTRING(Word, Start, Length) takes Length characters beginning at Start — drag the two handles and read the call it builds.
Pick one and the site follows you — notes, papers, videos and practice all open on it. · اختر واحدًا وسيتبعك الموقع — الملاحظات، الأوراق، الفيديوهات والتدريب جميعها تفتح عليه.
Type to search notes, lessons, code, vocabulary and past-paper questions across every subject. · اكتب للبحث عن ملاحظات، دروس، أكواد، مفردات وأسئلة امتحانات سابقة عبر جميع المواد.