What is abstraction?
Process of removing unnecessary detail and focusing on the important features of a problem so that it becomes easier to understand and solve.
Why is abstraction used in computer science?
What is representational abstraction?
Removes excess detail to create a simplified model of a problem that only includes key features.
What is abstraction by generalisation?
Identifying common patterns between problems so that one general solution can solve multiple similar problems.
What is data abstraction?
Hdes the internal representation of data and only exposes the operations that can be performed on it.
What are abstraction layers?
Divide a system into levels where each layer hides the complexity of the layer below it.
Give examples of abstraction layers.
Examples include programming languages (high-level language to machine code) and networking models such as TCP/IP layers.
Give advantages of abstraction.
Reduces program complexity, allows focus on key features, improves system design, and makes programs easier to maintain.
What is thinking ahead in program design?
Thinking ahead involves considering inputs, outputs, constraints, and possible errors before writing an algorithm.
What are inputs?
Inputs are data provided to a system that are required for processing, such as keyboard input, sensor data, or file data.
What are outputs?
Outputs are results produced by a program after processing input data, such as displayed results or printed reports.
What must programmers consider about inputs and outputs?
Input method, output method, data types used, and data structures used.
What is a precondition?
A precondition is a condition that must be true before a program or function can run correctly.
Give an example of a precondition.
Before popping from a stack the stack must not be empty; before pushing the stack must not be full.
Why are preconditions useful?
They simplify program design, reduce debugging, improve reliability, and make subroutines reusable.
What are reusable components?
Reusable components are program modules that can be used in multiple programs without modification.
Give examples of reusable components.
Functions, procedures, classes, and abstract data types.
Give advantages of reusable components.
Already tested so more reliable, reduces development time, reduces cost, and improves productivity.
What is procedural thinking?
Procedural thinking involves breaking a problem into ordered steps that can be executed sequentially.
What is problem decomposition?
Problem decomposition is breaking a complex problem into smaller manageable sub-problems.
Why is problem decomposition useful?
It simplifies complex problems, allows tasks to be divided among programmers, improves debugging, and improves organisation.
What is top-down design?
Top-down design starts with the overall problem and repeatedly breaks it into smaller sub-problems.
What is another name for top-down design?
Stepwise refinement.
What is stepwise refinement?
Progressively breaking a problem into smaller steps until each step can be implemented as a single task or subroutine.