Assignment 12

This assignment is worth 10 points.

Objectives

  1. Read chapter 6
  2. Define the following:
    1. Loop
    2. Algorithm Complexity
  3. Give the syntax for a while loop.
  4. Give the flow of control for a while loop.
  5. Give the preferred use for a while statement.
  6. State the conditions necessary for a successful loop.
  7. What is the result for each of the following independent code snippets? Why does this result occur
    1. int i=0;
      while(i<10);
          i++
            
    2. bool flag = false;
      
      whle (!flag) {
           flag = rand() % 1;
      }
            
    3. int i = 5;
      while(i == 10) {
          i++;
      }