SLR6 - 8

Cards (195)

  • Computational thinking
    A set of problem-solving methods that express problems and solutions in ways that a computer could execute
  • Computational thinking
    1. Understand the problem
    2. Formulate the problem
    3. Design an algorithm
    4. Implement the algorithm
    5. Run the code and solve the original problem
  • Abstraction
    A representation of reality that hides non-essential detail, leaving just the key elements of the problem
  • Data abstraction
    Using a data structure without being concerned about how it is implemented
  • Generalisation
    Solving new problems based on previous problems for which we have an existing solution
  • Abstraction enables teams of programmers to work on different aspects of a problem and enables programmers to use pre-built and built-in functions without concerning themselves with how they work
  • Layering is an example of abstraction where how one layer is implemented is of no concern to another layer
  • Abstraction is a simplification of reality where entities in the real world are represented by containers such as variables or data structures
  • In object-oriented programming, the objects are abstractions of real-world entities and the attributes and methods represent the real-world characteristics and actions
  • Devising an abstract model for a problem
    1. Can the problem be solved using a computer program?
    2. What are the key features of the problem?
    3. How will it be used?
    4. Who will be using it?
    5. What is the skill set of the target user group?
    6. What features are required by the target audience for the program?
  • Thinking ahead
    Planning inputs and outputs to a problem
  • Preconditions
    Requirements that must be met before a program can run
  • Preconditions can include requirements for the device specification, operating system, and any necessary additional software or hardware
  • Cache
    A temporary store where instructions or data that are likely to be needed are anticipated and stored, ready for fast access
  • Caching is used extensively for web access, where frequently used pages are stored for future use
  • Prefetching
    An algorithm predicts which instructions or data are likely to be required by a program and fetches the data likely to be needed next, storing it in a cache ready to be used
  • The advantage of reusing pre-written program components are that they are reliable and bug free, save time and development costs, and may be optimised for computational efficiency
  • Prefetching
    Loading a resource before it is needed. This can refer to commonly used web pages being requested before they are used. In this section, we are talking about instruction prefetching where the CPU caches instructions and data blocks before they are executed.
  • The need for reusable program components
  • Advantages of reusing pre-written components
    • They are reliable and bug free, having been tested and used many times
    • They save time for the programmer
    • They save on development costs for a project
    • In some cases, for example mathematical techniques, they will be optimised by experts for computational efficiency.
  • Modifying a similar pre-written code segment or function to fulfil the requirements
    1. Can reduce the time taken for development since it may only be the new elements that will require detailed testing
    2. There may be compatibility issues, which mean this is not possible
    3. In this case, it is more reliable and effective to start from scratch
  • Pre-written code for a game
    • Movement control
    • Timer routines
    • High-score tables
    • Rendering of images
  • Decomposition
    The process of breaking down a problem into smaller and smaller parts until each aspect of the problem can be dealt with effectively
  • Top-down design
    Used to make complex problems easier to understand and solve. Each branch is repeatedly subdivided until the problem is broken down into tasks at the lowest level that are able to be solved.
  • Identifying the components of a solution to a problem
    • Pre-written function or subprogram
    • Existing solution that can be modified
    • Individual task that can be allocated to a programmer
  • Ideally, each of the sub-problems represents a single, self-contained solution module that can be developed and tested independently
  • Data passes from one component of a solution to the next
  • Data from one module must be checked for validity before being passed on to another
  • It is important for processes to be executed in the correct order when a program is being used
  • A plan showing the order in which modules are needed, and those which can be produced simultaneously, is required for a large program with several programmers working together
  • Sub-procedure
    A named part of a larger process that may be used several times, like a function, but unlike a function, it will not return any values to the calling code
  • It is important to identify the sub-problems that form part of the main task when using sub-procedures
  • Induction
    Proposes a hypothesis (or idea) based on observations
  • Deduction
    Uses underlying rules to determine how a system should work
  • Paradigm
    A programming paradigm is an approach to programming, not a particular type of language. Programming languages can be classified by their features, but many will fit more than one paradigm.
  • Identifying decision points can be achieved in several ways, but often a flowchart or a pseudocode plan for the solution are used
  • The choice of programming language will determine what is possible. Alternatively, what is required will determine the choice of programming language.
  • A simple change, for example from 'greater than or equal to' to 'less than' in a condition, could make a significant change to the code structure that follows
  • A repeat loop will always execute at least once so is unsuitable when there is a possibility the loop may never need to execute
  • It is necessary to identify where the user needs to make decisions, identify and provide for all the possible outcomes from those decisions, and prepare routes through the program for all the possible outcomes from decisions