📚 Programming Techniques for Edexcel A-Level | Edexcel A-Level 编程核心技术
In Edexcel A-Level Computer Science, programming is assessed through both written papers and a practical project. Examiners expect you not only to understand syntax, but also to compare paradigms, evaluate data structures, trace recursive routines, and justify algorithm choices using Big O notation. This revision guide brings together the essential programming techniques you need to command in Paper 1 and in your non-exam assessment.
在 Edexcel A-Level 计算机科学中,编程通过笔试和课程项目两种方式考核。考官不仅要求你理解语法,还要求你比较编程范式、评估数据结构、跟踪递归例程,并使用大 O 表示法证明算法选择的合理性。本复习指南汇集了你在 Paper 1 和课程作业中必须掌握的核心编程技术。
1. Programming Paradigms | 编程范式
A programming paradigm is a fundamental style or way of programming. Edexcel focuses mainly on procedural programming and object-oriented programming (OOP), but you should also recognise event-driven, visual, and declarative paradigms in context.
编程范式是一种基本的编程风格或方式。Edexcel 主要关注过程式编程和面向对象编程 (OOP),但你也应在上下文中识别事件驱动、可视化和声明式范式。
In procedural programming, a problem is decomposed into procedures, functions, and modules. In object-oriented programming, a system is modelled as interacting objects, each combining data and behaviour.
在过程式编程中,问题被分解为过程、函数和模块。在面向对象编程中,系统被建模为相互作用的对象,每个对象将数据和行为结合在一起。
- Procedural: centred on actions and step-by-step control flow.
- Object-oriented: centred on objects, classes, and responsibilities.
中文对应:过程式以动作和逐步控制流为中心;面向对象以对象、类和职责为中心。
2. Procedural Programming Essentials | 过程式编程基础
All procedural programs are built from three control structures: sequence, selection, and iteration. Sequence means statements execute in order; selection means branching using if or switch; iteration means repeating using while, for, or repeat-until.
所有过程式程序都建立在三种控制结构之上:顺序、选择和迭代。顺序表示语句按顺序执行;选择表示使用 if 或 switch 进行分支;迭代表示使用 while、for 或 repeat-until 重复执行。
Modular design splits a program into named subprograms. Using procedures and functions reduces duplication, makes code easier to test, and supports top-down refinement.
模块化设计将程序拆分为命名子程序。使用过程和函数可以减少重复,使代码更易于测试,并支持自顶向下的逐步求精。
Parameter passing can be by value or by reference. By value copies the data, so changes inside the subprogram do not affect the original. By reference passes the memory location, so the original can be changed. Edexcel questions often ask you to trace both methods.
参数传递可以按值或按引用进行。按值传递会复制数据,因此子程序内部的更改不会影响原始数据。按引用传递会传递内存位置,因此原始数据可以被更改。Edexcel 试题经常要求你跟踪这两种方式。
3. Object-Oriented Programming Concepts | 面向对象编程概念
OOP organises code into classes, which are blueprints for objects. An object is an instance of a class and contains attributes (data) and methods (procedures that act on the data).
OOP 将代码组织成类,类是对象的蓝图。对象是类的实例,包含属性(数据)和方法(对数据进行操作的过程)。
Encapsulation hides an object's internal state and only exposes a controlled interface. Inheritance allows a subclass to reuse and extend the attributes and methods of a superclass. Polymorphism lets methods with the same name behave differently depending on the object type.
封装隐藏对象的内部状态,只公开受控接口。继承允许子类重用和扩展超类的属性和方法。多态使同名方法可以根据对象类型表现出不同的行为。
For example, the class Vehicle may have attribute speed and method accelerate(). A subclass Car inherits these and adds numberOfDoors; a subclass Bicycle overrides accelerate() to model pedal force differently. Aggregation models whole-part relationships, such as a Library containing many Book objects.
例如,类 Vehicle 可以有属性 speed 和方法 accelerate()。子类 Car 继承这些并添加 numberOfDoors;子类 Bicycle 重写 accelerate() 以不同方式模拟踏板力。聚合用于建模整体与部分关系,例如 Library 包含许多 Book 对象。
4. Recursion | 递归
Recursion is a technique in which a subroutine calls itself to solve a smaller instance of the same problem. A correct recursive routine must have a base case that stops the recursion, and a recursive case that moves towards the base case.
递归是一种子程序调用自身来解决同一问题的较小实例的技术。正确的递归例程必须
Published by TutorHao | A-Level 编程 Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图