After doing all parts of the lesson you should be able to answer these questions.
Write down the answers first. Click the to check your answer.
True or False: A loop always executes at least once.
What would be shown in the listbox by the code shown below:
int num = 4; do { num = num - 1; listBox1.Items.Add(num); listBox1.Items.Add("done"); } while (num <= 0);
3 What best describes this loop: int num = 1; while(num>0) { num += 2;}
4 What best describes this loop: int num = 0; while(num>0) { num += 2;}
5 What would be put in the listbox by this code:for(int num = 0; num < 3; num++) {listBox1.Items.Add(num);}
6 What would be shown in the listbox by this code:for(int num=5; num>0; num--) {lstBox.Items.Add num;}
7 What are the 3 types of loops?
8 True or False: A for loop always executes at least once.
9 True or False: A do loop always executes at least once.
Please review the material for any questions you miss.