MOD 3

Cards (11)

  • Repetition control structures are Java statements that allows to execute specific blocks of code a number of times.
  • Three types of repetition control structures:
    1. for loops
    2. while
    3. do-while
  • For loop allows execution of the same code a number of times
  • Initialization - initializes the loop variable.
  • Condition - compares the loop variable to some limit value
  • Step / iteration - updates the loop variable
  • For statement:
    1. Initialization
    2. Condition
    3. Step / iteration
  • while loop - statement or block of statements that is repeated as long as some condition is satisfied.
  • The statements inside the while loop are executed as long as the boolean_expression evaluates to true
  • The statements inside a do-while loop are executed several times as long as the condition is satisfied.
  • The main difference between a while and do-while loop is that, the statements inside a do-while loop is executed at least one