Software Engineering › Memorise › Year 11 content (Programming fundamentals, OOP, Mechatronics)
Year 11 content (Programming fundamentals, OOP, Mechatronics)
Syllabus: Programming fundamentals; The object-oriented paradigm; Programming mechatronics
Software development steps and algorithm design
answer3 marks
Eight steps — Requirements definition, determining specifications, design, development, integration, testing and debugging, installation, maintenance.
Standard algorithm features — Sequence (steps in order), selection (decisions), iteration (loops), and identifying the data that should be stored.
Divide and conquer — Break a big problem into smaller sub-problems, solve each, and combine the results (e.g. binary search, merge sort, structure-chart modules).
Backtracking — Try a choice, and if it leads to a dead end, step back and try the next option (e.g. maze solving, Sudoku).
Top-down v bottom-up — Top-down: start with the whole problem and refine it into subroutines (structure chart). Bottom-up: build and test small components first, then combine them.
Analysing an algorithm — Determine the inputs and outputs, the purpose, desk-check (trace with sample data), peer-check, and find how it connects to other subroutines or functions.
Procedure v function — A procedure performs a task; a function returns a single value (RETURN).
Online code collaboration tools — Platforms such as GitHub and GitLab allow sharing, version control, issue tracking, pull requests and review across a team.
Programming paradigms
terms
Imperative — Step-by-step commands that change state: control structures, variables, assignment statements, expressions and subroutines.
Object-oriented (OOP) — Organises code into objects created from classes, with attributes (data) and methods (behaviour); uses inheritance, polymorphism, encapsulation and message passing.
Logic — Programs are facts and rules; the system infers answers (e.g. Prolog). You define and edit facts, create/edit/remove rules, and display the solution and the rules used.
Functional — Programs are built from functions; call functions and use recursion; functions are first-class objects and collections; avoid changing state.
Procedural v OOP — Procedural: a list of procedures acting on separate data; data and code are separate and data is often global. OOP: data and methods bundled in objects, better encapsulation, reuse through inheritance, easier to maintain large programs.
Number systems, two's complement, characters
answer4 marks
Binary — Base 2, digits 0 and 1. Place values 128 64 32 16 8 4 2 1. Example: 1011 = 8+2+1 = 11.
Hexadecimal — Base 16, digits 0-9 and A-F (A=10 ... F=15). One hex digit = 4 binary bits. Example: 0xB3 = 1011 0011 = 179. Used because it is a compact way to write binary (colours #FF0000, memory addresses).
Decimal to binary — Divide by 2 repeatedly and read remainders upward, or subtract place values. 13 = 1101.
Two's complement — Represents signed integers. The leftmost bit is the sign (1 = negative). To negate: invert all bits and add 1. Example (8 bit): 5 = 00000101; invert = 11111010; add 1 = 11111011 = -5.
Range — With n bits, two's complement runs from -2^(n-1) to 2^(n-1) - 1 (8 bits: -128 to +127).
Adding negatives — Subtraction is done as adding the two's complement; ignore any carry out of the leftmost bit.
ASCII and Unicode — Characters are stored as binary codes. ASCII is 7/8 bit (128/256 characters); Unicode covers all languages and symbols. In Python: ord('A') = 65, chr(65) = 'A'. Knowing the codes lets you change case (lowercase = uppercase + 32) or do simple encryption (shift the code).
Standard data types — char and string, Boolean, real, single-precision floating point (32 bits), integer, date and time.
Data structures
terms
Array — A fixed-size, ordered collection of items of the same type, accessed by index (starts at 0 in Python). Multidimensional: a grid or table (list of lists).
List — In Python an ordered, changeable collection. my_list.append(x), len(my_list).
Record — A group of related fields of possibly different types about one thing (e.g. a student: name, ID, mark). In Python: a class or dictionary.
Sequential file — Records stored one after another and read in order from start to end (e.g. a text file read line by line).
Tree — Hierarchical nodes with a root and child nodes (e.g. folder structure, decision tree, binary search tree).
Stack — Last in, first out (LIFO): push to add, pop to remove the top (undo, function calls).
Queue — First in, first out (FIFO).
Hash table — Stores key-value pairs; a hash function turns the key into a location for very fast lookup. Python dictionary.
Object-oriented concepts
terms
Class — A blueprint (template) defining the attributes and methods of a kind of object.
Object — An instance of a class with its own attribute values.
Attribute — A variable that belongs to an object (data/state). Method :: A function that belongs to a class (behaviour).
Encapsulation — Bundling data and the methods that work on it inside a class and restricting direct access to the data (private attributes with getters/setters), so the data stays valid and secure.
Abstraction — Hiding complex implementation detail and exposing only what is needed (a user calls account.deposit() without knowing how it works).
Inheritance — A subclass (child) takes the attributes and methods of a superclass (parent) and can add or change them, giving code reuse. Models an 'is-a' relationship (Student is a Person).
Generalisation — Pulling shared features of several classes up into a common superclass (Student and Parent generalised as Person).
Polymorphism — Different classes provide their own version of the same method name, so the same call behaves differently depending on the object (speak() for Dog and Cat).
Message passing — Objects communicate by calling each other's methods (sending a message with parameters, getting a return value).
Facade pattern — A simple class/interface that hides a complex set of subsystem classes behind one easy interface.
Features supporting collaboration — Consistency (naming and style), code commenting, version control, and feedback (code review).
Good OOP code (spec) — Clear and uncluttered mainline; one logical task per subroutine; use of stubs; suitable control and data structures; ease of maintenance; version control; regular backup.
Testing and code quality (Year 11)
answer3 marks
Levels — Unit, subsystem and system testing.
Box testing — Black box (inputs/outputs only), white box (internal code and paths), grey box (partial knowledge).
Quality assurance — Processes to make sure the software meets quality criteria: functionality, performance, readability of code and quality of documentation.
Test data — Boundary values, path coverage, faulty and abnormal data.
Errors — Syntax (language rules broken), logic (wrong result), runtime (fails while running).
Optimisation — Improve efficiency in speed or memory (better algorithm, less repeated work, suitable data structures).
Mechatronics: hardware, sensors, actuators, control
answer5 marks
Mechatronic system — Combines mechanical engineering, electronics and software control (robots, automatic doors, drones, 3D printers, car cruise control, prosthetics).
Microcontroller and CPU — A microcontroller is a small computer on one chip (CPU, memory, input/output pins) dedicated to controlling a device; it executes program instructions using the CPU's instruction set.
Instruction set and opcodes — The instruction set is the list of commands the CPU understands; each instruction has an opcode (the operation) and operands. The instruction set limits what code can do and how efficient it is.
Registers — Fast storage inside the CPU: address registers hold memory addresses; data registers hold the values being processed.
Sensor — Input device that detects the environment and sends data (motion sensor, light level sensor, temperature, ultrasonic distance).
Actuator — Output device that causes movement or action (motors, servos, hydraulic actuators).
End effector / manipulator — The device at the end of a robotic arm that interacts with the world (robotic gripper, welder, suction cup).
Open-loop control — Output is set without checking the result (a timer-based sprinkler). Simple but cannot correct errors.
Closed-loop control — Sensors feed back the result and the algorithm adjusts the output to reach a target (thermostat, cruise control, line-following robot). Feedback makes it accurate.
Autonomous control — The system senses, decides and acts without human input (self-driving vehicle, robot vacuum) using sensor data and decision algorithms.
Degrees of freedom and motion constraints — Degrees of freedom = the independent directions/axes a part can move; motion constraints = limits on movement (range, speed, obstacles) the code must respect.
Power and wiring — Choose battery/power for each component's voltage and current; wiring diagrams use standard symbols (resistor, capacitor, diode, LED, switch, motor, voltage source) and show data and power connections; label other components clearly.
Data in mechatronics — Sensor data, diagnostic data (system health) and data used for optimisation (tuning performance).
Disability design — Specialist requirements (e.g. prosthetics or assistive devices need comfort, safety, intuitive control, adjustability, reliability).
Testing — Create unit tests to check the effectiveness and repeatability of each component's control algorithm; use simulations and prototypes before the real build.
Control loop (pseudocode) —
BEGIN FollowLine
WHILE robot is on
Read lightSensor
IF lightSensor is DARK THEN
Turn motor left
ELSE
Turn motor right
ENDIF
ENDWHILE
END FollowLine