Unit 6 - Algorithms

Subdecks (4)

Cards (17)

  • A logic error is an error in the way a program works. The program simply does not do what it is expected to do. Logic errors can have many causes, such as: incorrectly using logical operators, eg expecting a program to stop when the value of a variable reaches 5, but using <5 instead of <=5.
  • the three programming constructs:
    Sequence: the order of instructions e.g: indentation
    Selection: if, elif, else
    Iteration: for or while loops
  • A variable is a name or identifier for a memory location which stores data and can be changed while the program is running
  • count controlled loops use a for loop while condition controlled loops use a while loop
  • Procedures perform a specific task but do not return a value. Functions manipulate data and return a value to the main program.