0
A newbie in c++ need help with this question
Write a program that uses switch multiple selection statement to count the number of different grades.test it with the following input=A output=1
4 Antworten
+ 1
Valentine Gatwiri you're code logic is okay.
Now all you have to do is add declarations for the Count variables e.g. int aCount,bCount ...
and also cases for all the alphabetical letters(since you only want to use switch)e.g
0
void countGrades(char letter) {
switch (letter )
{
case 'A':
aCount +=1;
break;
case 'B':
bCount +=1;
break;
case 'C':
cCount += 1;
break;
default:
fCount += 1;
}
}
0
Ok thanks let me try that