import javax.swing.JOptionPane;
class Switch{
public static void main(String[]args) throws Exception{
String input = JOptionPane.showInputDialog("Enter");
int percentage = Integer.parseInt(input);
switch(percentage){
case 90:
JOptionPane.showMessageDialog(null, "A+ Grade");
break;
case 80:
JOptionPane.showMessageDialog(null, "A Grade");
break;
case 70:
JOptionPane.showMessageDialog(null, "B Grade");
break;
case 60:
JOptionPane.showMessageDialog(null, "C Grade");
break;
case 50:
JOptionPane.showMessageDialog(null, "D Grade");
break;
case 40:
JOptionPane.showMessageDialog(null, "IMPROVED");
break;
default:
JOptionPane.showMessageDialog(null, "Fail");
}
}
}
class Switch{
public static void main(String[]args) throws Exception{
String input = JOptionPane.showInputDialog("Enter");
int percentage = Integer.parseInt(input);
switch(percentage){
case 90:
JOptionPane.showMessageDialog(null, "A+ Grade");
break;
case 80:
JOptionPane.showMessageDialog(null, "A Grade");
break;
case 70:
JOptionPane.showMessageDialog(null, "B Grade");
break;
case 60:
JOptionPane.showMessageDialog(null, "C Grade");
break;
case 50:
JOptionPane.showMessageDialog(null, "D Grade");
break;
case 40:
JOptionPane.showMessageDialog(null, "IMPROVED");
break;
default:
JOptionPane.showMessageDialog(null, "Fail");
}
}
}
No comments:
Post a Comment