(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
Source: Cambridge International syllabus · แหล่งที่มา: หลักสูตร Cambridge International
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.
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.
ไทย
การรวมผล (totalling) — เพิ่มค่าเข้าไปในผลรวมสะสม: Total ← Total + Value.
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. · พิมพ์เพื่อค้นหาบันทึก, บทเรียน, โค้ด, คำศัพท์ และคำถามข้อสอบเก่าในทุกวิชา