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

public class BPIH4E10C
{
// 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);
switch(grade)
{
case 'A': case 'a':
Anumber++;
break;
case 'B': case 'b':
Bnumber++;
break;
case 'C': case 'c':
Cnumber++;
break;
case 'D': case 'd':
Dnumber++;
break;
case 'E': case 'e':
Enumber++;
break;
case 'F': case 'f':
Fnumber++;
break;
default:
b=false;
break;
} // end of switch-case
}//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
