Paper 2

Cards (85)

  • Abstraction
    removes unnecessary details from a problem in order to solve it
    allows us to separate the ‘logical’ from the ‘physical’
    e.g. the London Tube map, only know what stations are on the line, not the distance or which direction
  • Decomposition
    involves the breaking down of a problem into smaller, simpler steps or stages
    use structure diagram to break it down
    Each box can be further subdivided until each box represents a single, simple subtask
    when tasks broken down / decomposed, it is easier to solve the problem
  • Pseudocode
    code written down
    better to write indents
  • Syntax error
    spell incorrectly, missing correct punctuation
  • Logical Error
    code will not work how programmer intended
  • High level Programming
    Python, Visual Basic, C#, Java
  • Low Level Programming Language
    Assembly Language
  • Binary Search:
    • happens only if the list is sorted
    • more efficient than linear search
    • works by repeatedly dividing in half the portion of the data list that could contain the required data item
    • Continued until there is only 1 left in the list
  • Linear Search
    • when data unsorted
    • start at beginning and look through every item
  • DIV (// in python)
    • an integer division
    • works like normal division but returns the whole number (no decimal)
  • MOD (% in python)
    gives the remainder of integer division
  • Sequence
    • the statements are executed one by one in the order they are written
    • all programs have a series of steps to be followed in sequence
    • Sequence may be a series of calls to different subroutines which perform different tasks
  • Selection
    • an IF statement is a type of selection statement
    • the next statement to be executed depends on whether the condition being tested is TRUE or FALSE
  • Iteration
    means repetition
  • Iteration statements
    • fornext
    • whileendwhile
    • dountil
  • Boolean Operators AND
    AND - semi circle shaped diagram
  • Boolean Operators OR
    OR - deformed triangle shape
  • Boolean Operators NOT
    NOT - triangle shaped
  • Data Types
    Integer
    Real/Float
    Boolean
    Character
    String
    Casting
  • Integer
    a whole number (3, 45, -453)
  • Real/float
    a number with decimal (34.456, -9.234, 4.0)
  • Boolean
    has the value TRUE or FALSE
  • Character
    • a single character
    • any letter, digit, punctuation mark or symbol that can be typed
  • String
    • 0 or more characters
    • can be null (empty), just one character or several characters
  • Casting
    • changing the type of variable value from one type to another
    • using functions such as int(), float() or str()
  • Types of string Manipulation
    length of string
    substring
    convert cases
    find position of a character or the start of string
  • length of string
    stringname.length
  • substring

    stringname.substring(StartingPosition, numberOfCharacters)
  • convert cases
    • stringname.upper
    • stringname.lower
  • find position of a character or the start of string
    stringname.index()
  • SQL Key Words
    SELECT
    WHERE
    FROM
  • Example of how to use SQL
    SELECT FirstName, Surname
    FROM members
    WHERE Town = 'Ipswich'
  • 1-dimensional Array
    • first element of array has a subscript of 0, e.g. 3rd box is 2
    • Individual boxes can be used just like variables
    • Can assign, input and output values to them
  • 2-dimensional arrays
    a collection of data elements arranged in a grid-like structure with rows and columns
  • Anticipating Misuse
    programmer must try to make sure that whatever a user enters when they run a program, it will not crash or give incorrect result
  • Authentication Routines
    optical, facial or fingerprint recognition
  • Input Validation
    Range Check
    Type Check
    Length Check
    Presence Check
    Format Check
  • Range Check
    a number of date is within a sensible/allowed range
  • Type Check
    data is the right type such as an integer or a letter or text
  • Length Check
    text entered is not too long/short → password greater than 8 but less than 25