Thread: JAVA code
View Single Post
Old Mar 25th, 2008, 1:20 PM   #1
A.K.Al Shamsi
Programmer
 
A.K.Al Shamsi's Avatar
 
Join Date: Mar 2008
Posts: 35
Rep Power: 0 A.K.Al Shamsi is on a distinguished road
Exclamation JAVA code

hi.... how are you guys???
i am programming and we just start taking Java this semester so if anyone could help by checking it, i will be grateful

i was practicing and for some reasons the programme doesn't work completely.... i don't have error syntax...

here is the code:

import javax.swing.*;
import java.lang.String;

public class Grade{
    public static void main(String args[]){
        
        int grade=0, cat;
        String g, a,b,c,d,e;
        
        cat= grade/10;
        
        g=JOptionPane.showInputDialog("Enter your grade");
        
        grade=Integer.parseInt(g);
        
        switch(cat){
            case 1: 
               
                 JOptionPane.showMessageDialog(null,"Prefect score");
            break;
            
            case 2:
             
                JOptionPane.showMessageDialog(null,"well done");
            break;
       
            case 3:
               
                JOptionPane.showMessageDialog(null,"Above the averageg");
                break;
             
            case 4:
                
                JOptionPane.showMessageDialog(null,"Average");
                break;
                
            case 5:
              
                JOptionPane.showMessageDialog(null,"Below the average... Shame on you");
                break;
                
            
            
        }
        
        
        
    }
}
A.K.Al Shamsi is offline   Reply With Quote