CS 2.2 Programming

Cards (14)

  • Sequence: Code is executed line-by-line, from top to bottom
    Branching: Particular block of code is run if a specific condition is met. Uses IF and ELSE statements
    Iteration: Can be either: Count-controlled: Block of code executed a certain number of times, Condition-controlled: Block of code is executed while a condition is met. Uses FOR, WHILE or REPEAT UNTIL loops
  • Local Variables: Can only be accessed within the subroutine in which they were defined. Multiple local variables with the same name can exist in different subroutines. Are deleted once subroutine ends. Using local variables ensures subroutines are self-contained
  • Global Variables: Can be accessed across the whole program. Useful for values that need to be used by multiple parts of the program. Danger of being unintentionally edited. Not deleted until program terminates, so require more memory
  • Modular programming is a technique used to split large, complex programs into smaller, self-contained modules. Easier to divide tasks between a team and manage projects. Simplifies the process of testing and maintenance, as each component can be dealt with individually. Improves reusability of components
  • Top-down Design/ Stepwise Refinement: Technique used to modularise programs. Problem is broken down into sub-problems, until each is represented as an individual, self-contained module which performs a certain task. Modules form blocks of code called subroutines
  • Features of IDEs include: ○ SteppingVariable watchBreakpointSource code editorDebugging tools
  • Problem recognition: Stakeholders state what they require from the solution. Information used to clearly define the problem and system requirements
  • Use of divide and conquer: Problem-solving technique that can be broken down into three parts: Divide Halves the size of the problem with every iteration, Conquer Each subproblem is solved, often recursively, Merge Solutions to the subproblems are then recombined, Applied to problem-solving in quick sort, merge sort and binary search. Simplifies complex problems very quickly
  • Backtracking: Problem-solving technique implemented using algorithms, often recursively. Methodically builds a solution based on visited paths found to be correct. If a path is found to be invalid, algorithm backtracks to the previous stage
  • Data mining: Technique used to identify patterns or outliers in large sets of data collected from a variety of sources, termed big data. Spots trends or correlations between data which are not immediately obvious. Insights from data mining can aid predictions about the future. This makes data mining a useful tool in assisting business and marketing decisions
  • Heuristics: Non-optimal, ‘rule-of-thumb’ approach to problem-solving. Used to find an approximate solution when the standard solution takes too long to find. Solution found through using heuristics is not perfectly accurate or complete. Used to provide estimations for intractable problems, shortest path-finding problems, machine learning and language recognition
  • Performance modelling: Mathematical methods used to test various loads on different operating systems. Provides cheaper, less time-consuming or safer method of testing applications.Useful for safety-critical computer systems, where a trial run is not feasible
  • Pipelining: Process in which modules are divided into individual tasks, with different tasks being developed in parallel. Enables faster project delivery. Output of one process typically becomes the input of another
  • Visualisation: Data can be presented in a way that is easier for us to understand using graphs, trees, charts etc. Makes it possible to identify trends that were not otherwise obvious.