CS201 1st Assignment Solution

using namespace std;
#include
#include
main()

{
int totalstudent=1;
int A =0,B=0;

char grad(1);

while (totalstudent <= 10)
{
cout"Please Enter Grade of student "totalstudent" :\n";
cin>>grad;
if (grad=='a' or grad =='A')
{
A = A+1;
totalstudent++;
}
else if (grad=='b' or grad =='B')
{
B += 1;
totalstudent++;
}
else
{
cout"\nPlease Enter 'A' or 'B' grade only! \n";

}
}

cout"Total No. of A Grades "A" :\n";


if (A <=2)
{
cout"\nYour class is Poor!\n";
}else if (A <=7)
cout"\nYour class is Good!\n";
else
{
cout"\nYour class is Brilliant!\n";
}
getche();

}

0 comments: