You have several problems here.
#1:
1 2 3 4 5
|
case 1:
for (i = 0; i < NUMELS; i++)
cout << "enter a grade";
cin>>grade[i];
break;
|
Note that since you don't have any braces in that for statement, the cin line is not part of the loop. This code will simply print "enter a grade" NUMELS number of times, then actually get input from the user
only once.
If you the user to enter several grades, you'll need to put that
cin >> grade[i];
line as part of the loop.
#2:
1 2 3
|
const int NUMELS = 1;
//...
for (i = 0; i < NUMELS; i++)
|
NUMELS is 1, so you're only looping once. If you want to loop more times, you'll need to increase NUMELS.
#3:
1 2 3
|
case 2:
cout <<"all the marks entered are:"<< grade[i]<<endl;
break;
|
What is i? Which grade are you trying to print?
If you want to print all the grades, you'll need to loop.
grade[i]
only gives you a single grade from the array, it does not give you all grades.