Component 2

Cards (35)

  • What is abstraction? Abstraction is a computational method where ideas are separated from instances of said ideas. Abstraction hides away details about a problem allowing the computational structures to be isolated. Only details that matter towards solving the problem are considered.
  • What is an abstract model? A model of a system which is taken from an abstracted real-life situation/problem.
  • What is recursion? Recursion is the ability for a subroutine/function to call itself until a terminating/base condition is met.
  • What is a function? -A block of code which has an identifier -It can take in parameters -Returns a value -Has a single task indicated by the name (identifier) of the function
  • What is a parameter? A parameter is a data structure passed into a subroutine when it is called.
  • What does it mean to pass in a parameter by value? When the subroutine is called a copy of the data is used by the subroutine and is discarded when the subroutine finishes.
  • What does it mean to pass in a parameter by reference? The memory location of the parameter is used instead of the actual data itself. This means any changes to the variable are retained after the subroutine finishes.
  • What is concurrent processing? Concurrent processing is designing/programming a system so that multiple things/processes can occur simultaneously.
  • What is decomposition? Decomposition is the breaking down of a problem into smaller subproblems which are individually easier to solve. The subproblems can sometimes be solved recursively.
  • What is object-oriented programming? A programming paradigm which uses objects which interact.
  • Explain why abstraction is needed. -It would be impossible to solve real-world problems without abstraction because real-world problems always include unnecessary details. -Abstraction helps us solve problems by separating problems into components and deciding which components matter.
  • Describe what is meant by a "layer"" of abstraction" -An abstraction can be created for a complex system to represent a large problem -Lower-level abstractions can be created to deal with each component of this large problem -This is useful because details in each layer can be hidden from the others -Layering is used in construction of large systems -Layers divide the functionality of a system into separate areas
  • Explain how "thinking ahead"" is used when programming a system" -The necessary outputs are determined -The necessary actions to achieve said outputs are determined -The resources are considered -The user expectations are considered
  • Explain why "thinking ahead"" is useful" -To decide what to achieve beforehand -To determine what must be done beforehand -To determine what is possible and what is impossible
  • Give a computational example of "thinking ahead""" Caching is one example because the user expectation is that the PC will run at a decent performance the resources and outputs are the instructions/data to be stored the necessary action is to store said instructions/data in a low-capacity memory unit near the CPU so that data/instructions can be fetched quickly.
  • Describe prefetching -Anticipated instructions are fetched before they are needed -They are placed in cache from which they can be obtained quickly -No delay in accessing slower RAM -Example of thinking ahead
  • Explain the need for reusable program components -Important from a business point of view (more economical & time saving etc) -Important to support future development (more modular etc) -Most systems are designed by composing pre-existing components that have been used in other system
  • Give 5 advantages and 5 disadvantages of reusable program components. Adv:-Increased dependability: Bugs & faults will have already been identified so it is more dependable than new software. -Reduced risk: The cost of existing software is already known but the cost of developing new software is hard to predict -Specialists: Specialists do not have to repeat the work they have already done they can just make reusable software that encapsulates their knowledge. -Standardisation: Standards can be implemented as a set of reusable components for example so that applications have the same menu format -Development time: Speeds up system production development and validation. Disadv: -Increased maintenance costs: Maintenance costs can be higher because there may be incompatibilities between reused components. -Lack of support: May be difficult to integrate tools with computer libraries -NIH systems: rewriting may be preferable because improvements can be made -Creation of components: It can be expensive to create and ensure that developers know how to use the library -Adapating reusable components: Components have to be adapted for a new environment
  • Describe caching. -Data that is input may be stored in RAM if it is needed before the process is shut down. -If it is required it does not need to be read from disk so faster loading time. -Prefetching is used to request instruction from memory before it is required to speed up the process. -Example: Caching webpages. -Example: Cache (In the execution of programs with the CPU)
  • Give 1 advantages and 2 disadvantages of caching. Adv: -Reduces load on webserver because required data can be anticipated Disadv: -Can be complicated to implement -If wrong data is cached then it can be difficult to re-establish the correct sequence of data
  • Explain why decomposition is used and how it links to procedural thinking -It is used because it makes problems more managable. -Large problems are divided into subproblems. -Eventually each subproblem can be handled by a program module or group of program modules. -Order of execution matters; this is why procedural thinking is needed -Some subproblems may need to be accessed in an unpredictable way
  • Explain why the order of steps in solving a problem is relevant -When planning a solution the order may or may not be important -In event-driven situations the order may be unpredictable -In other situations order can be important because sometimes steps have to be completed for other steps to begin
  • Describe concurrent thinking. -Modern computers can process a large number of instructions at the same time -Thanks to chip multiprocessors and pipelining -Programs have to be specifically designed to take advantage of this -Concurrently processed modules should be independent -Can save a lot of processing time if well-designed -Can also be applied to human activities -Gantt charts used to visualise concurrent activities
  • Describe parallel processors -Programs are split into computationally independent jobs -Each job is executed simultaneously -Not always possible if jobs depend on eachother -Multicore processors are becoming more common -Programs are executed faster and less energy is used for the same throughput
  • Describe the 3 programming constructs -Sequencing: Statements are executed one-after-another -Iteration: The same section of code / set of statements is executed multiple times until a condition is met or a certain count has been reached. -Selection: Carrying out a set of instructions based on a condition. Uses if/else statements.
  • Describe local and global variables. -Local: Declared and only available within the scope of the relevant module/function/subroutine. Destroyed when the program leaves the scope. -Global: Declared outside of subroutines at the top of the program. It can be accessed anywhere from within the program. It is not destroyed until the program finishes execution. A local variable with the same identifier as a global variable will have priority over the global variable when used in its scope. Local variables should be used where possible since they use less memory and make the program much easier to follow.
  • State 11 features provided by an IDE. -Debugger -Code editor -Translators -Integrated Runtime Environment -Auto Documentation -Syntax Highlighting -Syntax Checking -Code Completion -Auto Indentation -Project navigation -Error diagnostics
  • Explain the difference between recursion and iteration -Recursion is when a subroutine calls itself until a base condition is met in a finite number of calls -Iteration is the repeated execution of a section of code until a count or a condition is met -Recursion is less memory efficient than iteration -Recursion uses a stack; there is a limit to how many layers of recursion there can be on the stack until the program runs out of working memory and crashes
  • 5 stages of algorithmic thinking -Understand the problem -Formulate the problem -Design an algorithm -Implement the algorithm -Run and solve problem
  • Describe top-down problem solving An approach to problem solving which starts with the bigger picture and breaks down the problem into subproblems which can be represented as black boxes. This can be done to divide a large program into modules where each module solves a single problem before the modules are put together.
  • Describe backtracking An algorithmic approach to problem-solving where partial solutions are built up as a pathway to follow. If one pathway fails at one point then the search begins at the last potentially successful point
  • Describe data mining -The process of searching through a large quantity of data -Using algorithms that search for useful relationships and facts that are not immediately obvious -Used when data comes from data sets that are not structured in the same way -Performances searches to find patterns -Possible because of large databases & fast processing
  • Describe pipelining -Output of one process is the input to another process -Useful in RISC structures
  • Describe visualisation -Present data in an easy-to-grasp form -For example table data as a graph -Can make unnoticed facts and trends apparent
  • Describe heuristics. -Technique for solving problem quickly when classic methods are too slow -Heuristic function ranks alternatives in search algorithms at each branching step to decide which branch to follow -This approximates the exact solution -May not give optimal solution -May not give all of the solutions -Can give a confidence interval for the optimal solution