If I write a partial code to read in an integer from the keyboard (the integer should be 1, 2, 3, or 4) and display to the monitor Freshman, Sophomore, Junior, or Senior respectively. If not one of these integers, display an appropriate message which I made unknow. I need to use a switch statement is this correct?
int high_school;
cout <<"Enter a number";
cin >> high_school;
high_school/=4;
switch(high_school)
{
case '1': cout <<"Freshman";
break;
case '2': cout <<"Sophomore";
break;
case '3': cout <<"Junior";
break;
case '4': cout <<"Senior";
break;
default: cout <<"Unknow";
}
I know I can use a switch statement...I am not asking if I can I am asking am I on the right track, am I right, and if not can someone tell me what I am doing wrong?? THANK YOU