1/19
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
The process of removing unnecessary details from a problem when creating a solution to focus on the most important features of the problem. It simplifies the problem by reducing its complexity
Why is abstraction needed for a programmer
It makes it easier to design, read and maintain code, speeding up the development time of a solution and improving system maintenance. It also saves memory and processor time when a program is being run since the removal of non-essential details decreases the amount of computer time and resources the program uses.
Why is abstraction needed for a user
A program is more likely to suit a user’s needs by focusing more on the important features of the problem. Complex details are hidden from the user, allowing them to interact with and use a solution without needing to understand how it works. Smaller programs that require less resources are more accessible to users with lower-spec devices.
What is program decomposition
The process of splitting a problem into a series of smaller, more manageable sub-problems that can be more easily tackled/solved.
Why is decomposition needed (for a programmer)
Breaking down a problem into individual components allows programmers to identify any program functions/modules that are reusable and any that can be worked on concurrently. The development of individual modules can be split up between programmers, and each can be tested in isolation, making debugging easier.
What is a precondition
A statement/condition that must be true before an algorithm or subroutine can be called and executed. This prevent errors or crashes from occuring if this algorithm is used with values it cannot process.
What is a variable
A named storage location in memory that holds a value and that value can be changed.
What is casting
The process of converting a piece of data in one data type to another data type.
What is selection
When a program makes a decision based on the evaluation of a Boolean expression/condition, which determines which block of code, algorithm or subroutine is run next.
What is sequence
The execution of instructions one line after another in a specific, sequential, chronological order.
What is iteration
The repeated execution of a specific few lines of/block of code using a loop. This can be count-controlled (executing a set number of times) or condition-controlled (executing until a specific condition is met).
What is a subroutine
A self-contained, standalone block of code within a larger program that performs a specific task. It is given a specific, unique name so that it can be called multiple times from different places within the program, allowing code reusability.
What is problem recognition
The process of identifying that a problem exists, analysing and understanding its true nature, and determining whether it can be solved using computation methods.
What are the features of a recursive algorithm
The algorithm must call itself. Each recursive call of this algorithm creates a new copy of the values being used in the subroutine, which are added to a stack of subroutine calls. There must be a base case that stops the algorithm calling itself after a finite number of calls.
What is a global variable
A variable declared in the main body of a program, outside of any subroutines, that can be accessed and modified from anywhere within the program, and remains in memory from its declaration to when the program terminates.
What is a local variable
A variable declared inside a specific algorithm or subroutine, that is only accessible within that subroutine and only exists while the subroutine is running (is destroyed when it terminates).
What are the advantages and disadvantages of global variables
They can be read and edited by any part of the program, making them easily accessible but easy to accidentally modify or overwrite. They remain in memory for the duration of the program’s execution, improving data persistence but increasing memory usage of the program. They make programs harder to test and maintain.
What are the advantages and disadvantages of local variables
They can only be accessed and updated within their subroutine, preventing unintended modifications but also making them harder to use since they need to be passed as parameters. They are stored in memory only during the execution of the program, making them more memory efficient but their data less persistent. They make programs easier to test and maintain.
What is passing a parameter by value
A copy of the data to be used is passed into a subroutine, so that changes made to the parameter inside the subroutine do not affect the data in the original variable.
What is passing a parameter by reference
A pointer to the memory address of the original variable is passed into the subroutine, so that changes made to the parameter inside the subroutine directly and permanently alter the data in the original variable.