Programming constructs

Cards (9)

  • Programming constructs
    1. Selection
    2. Sequence
    3. Iteration
  • Sequence
    Executing one instruction after another
  • Branching
    Program can end up going in a number of various directions depending on the outcome of a condition
  • If statement

    First typical selection construct, allows program to execute different lines of code based on a condition
  • Switch/Select Case statement

    Allows program to branch in more than one direction depending on the value of a variable
  • Iteration/Looping

    Repeating sections of code
  • For loop

    Counter controlled loop, used when the number of iterations is known ahead of time
  • While loop

    Condition controlled loop, used when the number of iterations is not known ahead of time
  • Do-until loop

    Condition controlled loop that executes the code at least once before checking the exit condition