Assignment 12
This assignment is worth 10 points.
Objectives
- When you finish this assignment you should be able to
- Correctly use terms associated with loops.
- Identify common progblems associated with loops.
- Read chapter 6
- Define the following:
- Loop
- Algorithm Complexity
- Give the syntax for a while loop.
- Give the flow of control for a while loop.
- Give the preferred use for a while statement.
- State the conditions necessary for a successful loop.
- What is the result for each of the following independent code snippets? Why does this result occur
-
int i=0;
while(i<10);
i++
-
bool flag = false;
whle (!flag) {
flag = rand() % 1;
}
-
int i = 5;
while(i == 10) {
i++;
}