Wyo C++ - Ch. 7 Notes

Objective #1: Understand how decisions are made in programs.

Objective #2: Understand how true and false is represented in C++.

Objective #3: Use relational operators.

Objective #4: Use logical operators.

Objective #5: Use the if structure.

Objective #6: Use the if/else structure.

Objective #7: Use nested if structures.

Objective #8: Use the switch structure.

switch(characterEntered)
{
   case 'A':
   case 'B':
       cout << "You entered a B";
       break;

   default:
       cout << "Illegal entry";
       break;
}

However, in the following example, the would be no output if characterEntered = 'A':

switch(characterEntered)
{
   case 'A':
       break;
   case 'B':
       cout << "You entered a B";
       break;

   default:
       cout << "Illegal entry";
       break;
}