Details of the switch Statement

switch (grade) { case 'P' : cout << "You are passing." << endl; cout << "Therefore, you will get credit"; cout << endl; break; case 'N' : cout << "You are NOT passing." << endl; cout << "Therefore, you will NOT get credit"; cout << endl; break; default : cout << "Grade must be P or N" << endl; break; }

Previous page
Next page

Back to Lesson 8 Index
Back to Outline