Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

//Purpose: This program displays a student\'s classification (e.g., \"freshman\"

ID: 3655465 • Letter: #

Question

//Purpose: This program displays a student's classification (e.g., "freshman", // "sophmore", etc.) based on an integer classification code that is // read in. In it's current form, this program uses nested IF statements // to encode a "multiway branch" or "case construct" to determine the // student's classification. // As part of an exercise, the IF statements should be completely // replaced by a SWITCH statement; that is, afterwards no IF statements // will exist in the modified code. The encoding scheme is: // 1 2 3 4 5 6 // freshman sophomore junior senior graduate graduate //include files... #include using namespace std; int main() { int classification; //classification of a student // input student's information cout << "Enter the student's classification code number (1-6): "; cin >> classification; cout << "Your classification is " ; // Check for a valid classification and proceed accordingly // Replace the following nested if statement with a switch statement // Complete the switch statement started in the following line: switch Replace the following by completing the switch statement started above. if (classification >= 1 && classification <= 6) { //display appropriate classification phrase if ( classification==1) cout << "freshman"; else if (classification==2) cout << "sophomore"; else if (classification==3) cout << "junior"; else if (classification==4) cout << "senior"; else cout << "graduate"; cout << "." << endl; } else cout << "unknown. Invalid classification code." <<endl;

Explanation / Answer

#include using namespace std; int main() { int classification; //classification of a student // input student's information cout > classification; cout