import javax.swing.*; // program uses class Scanner

public class BPIH4E11C
{
// main method begins execution of Java application
public static void main( String args[] )
{              
String s1="";
char grade;
boolean b=true;
int Anumber=0,Bnumber=0,Cnumber=0,Dnumber=0,Enumber=0,Fnumber=0;
while(b)
{ 
s1=JOptionPane.showInputDialog("Enter Student\'s grade: "); // read grade
grade=s1.charAt(0);
if(grade=='A'||grade=='a')
{Anumber++;}
else if(grade=='B'||grade=='b')
{Bnumber++;}
else if(grade=='C'||grade=='c')
{Cnumber++;}
else if(grade=='D'||grade=='d')
{Dnumber++;}
else if(grade=='E'||grade=='e')
{Enumber++;}
else if(grade=='F'||grade=='f')
{Fnumber++;}
else
{b=false;}
}//end of while
String s="Total of each grade : \n";
s+="A : "+Anumber+"\n";
s+="B : "+Bnumber+"\n";
s+="C : "+Cnumber+"\n";
s+="D : "+Dnumber+"\n";
s+="E : "+Bnumber+"\n";
s+="F : "+Fnumber+"\n";
JOptionPane.showMessageDialog(null,s,"Total number of each grade",JOptionPane.PLAIN_MESSAGE); //display x and y
     } // end method main
} // end class BPIH4E10C
