![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Mar 2008
Posts: 35
Rep Power: 0
![]() |
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;
}
}
} |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Incorporating javascript code into java application | csrocker101 | Java | 1 | Feb 11th, 2008 6:36 AM |
| Java code.....null pointer exceptions(again sorry) | ELHEK | Java | 2 | Oct 25th, 2006 1:56 PM |
| Java code to convert binary to decimal and hexadecimal to binary | prince_haldir | Java | 1 | Mar 7th, 2006 1:51 AM |
| Problem in my Java Code | jch02140 | Java | 6 | Aug 14th, 2005 3:08 PM |