Programming

Subdecks (1)

Cards (47)

  • READ file.name variable_name
  • Each READ in pseudocode reads a line
  • WRITE file.name value
  • computers perform branching instructions by transferring control to different parts of the program, depending on the result of a decision
  • In all programming repsonses where code is given use line numbers, except for high mark repsonses. It is not needed there
  • Abstraction is hiding unnecessary detail, generally lower level parts hidden from higher parts of a program. For example a main would likely call functions, which acts as general detail, where as the declaration is specific detail
  • An abstraction layer contains inputs, outputs. Additionally it may contain variables and constants, aswell as key processes and repeated processes.
  • Presence checks are done with a comparison of a variable to None, however if it is a string such as input then use quotation marks with an empty string
  • Type checks are done in python using isinstance() for a boolean result, however for inputs you must use try... except... blocks
  • Format checks are best done using slices and in
  • Insertion sorts are very slow, however they are useful when adding an element to a sorted array
  • Insertion sorts work by:
    1. Compare first element to new element
    2. Shift the unsorted element to its correct position.
    3. Advance the sorted/unsorted list marker to the right one element.