CS 1440 Lab 9

Cover sheetPrevious ActivityNext Activity                                                         Pre-Lab


Background

Read pages 385 - 392 and 403 - 413 of the text. Now here are some questions for you:

1. Explain what happens when you forget a break in a switch-statement.









2. What C++ types can be used in the controlling expression of a switch-statement?









3. Convert the following code segment using a while loop to one which uses a for loop.

int cnt=0;
while(cnt<10)
{
   cout << "Hello World!" << endl;
   cnt++
}