1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is abstraction?
Removing unnecessary detail
Simplifying a complex problem
Focussing on only the necessary/main parts
What is representational abstraction?
A representation arrived at by removing unnecessary details from the real-world entity, leaving only the features relevant to the problem being solved.]
Simplified model of something real
Example: tube map
What is abstraction by generalisation?
Grouping together similarities within a problem to identify what kind of problem it is.
Example: Vehicles include cars, lorries, motorbikes, etc.
What is data abstraction?
Details about how data is being stored are hidden
Example: using a stack without knowing how it is implemented
What is procedural abstraction?
Performing functions without having any knowledge about the code used to implement the function.
Example: using print() without knowing the underlying code
What is the need for abstraction?
Allows non experts to make use of a range of systems / models by hiding information that is too complex / irrelevant for the system’s purpose.
What are the advantages of abstraction?
Enables for more efficient / less complex design
Reduces time needed on projects
Prevents programs from getting unnecessarily large
What is a precondition?
Requirements that must be met before a program can be executed
What are the advantages of using reusable program components?
More reliable then newly coded components - already been tested > saves time + cheaper + saves resources
Can be reused in future projects > saves development costs
What is meant by thinking procedurally?
Breaking a problem down into smaller parts which are easier to understand and therefore easier to design
What is problem decomposition?
A large, complex problem is continually broken down into smaller subproblems which can be solved more easily
Becomes more feasible to manage
What is the programming construct ‘sequence’?
Code is executed line by line, from top to bottom
What is the programming construct ‘selection’?
A certain block of code is met if a specific condition is met
Uses IF statements
What is the programming construct ‘iteration’?
A block of code is executed a certain number of times OR until a condition is met
Uses FOR, WHILE, REPEAT UNTIL loops
What are the 2 types of iteration?
Count controlled: Iterates a number of times (FOR)
Condition controlled: Iterates until a condition is met (WHILE)
What is a local variable?
A variable which has a limited scope which means that they can only be accessed within the block of code in which they were defined (normally a single function or procedure)
What is a global variable?
A variable which can be accessed across the whole program
Why is using local variables considered good practice?
It ensures subroutines are self-contained, with no danger of variables being affected by code outside of the subroutine
Local variables also take up less memory compared to global variables
What is meant by modular programming?
A programming technique used to split large, complex problems into smaller, self contained modules
What is the top down approach to modularise problems?
Continually breaking down a problem into sub programs, until each can be represented as an individual, self contained black box which performs a certain task.
Also known as stepwise refinement
What is similar about procedures and functions?
They are both named blocks of code that perform a specific task
How do functions and procedures differ?
Procedures do not have to return a value, however if they do they can return multiple values
Functions must always return a value, and they can only return one singular value
What are the 2 different ways a parameter can be passed into a subroutine?
By value
By reference
What does parameter passing by value mean?
A copy of the value is passed into the subroutine and discarded at the end > its value outside the subroutine will not be affected
procedure abc(x:byVal)
What does parameter passing by reference mean?
The address of the parameter is given to the subroutine, so the value of the parameter will be updated at the given address
procedure abc(x:byRef)