Results 1 to 3 of 3
- 03-01-2010, 08:19 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 1
- Rep Power
- 0
How do i make this work What am i doing Wrong.
import javax.swing.JOptionPane;
public static void passOrFail{
{
public static void main (String[] args)
int mark;
String numStr;
numStr=JOptionPane.showInputDialog("What is the Mark?:");
mark=Integer.parseInt(numStr);
if(mark>=40)
JOptionPane.showMessageDialog(null, "passed");
else
JOptionPane.showMessageDialog(null,"failed");
JOptionPane.showmessageDialog(null,"Bye");
}
}
Im using JE creater Pro. and this was a sample question in the text book we use well they gave us this code. So im wondering how i would make it work.
The codes suppose to
1) get the mark from a student
2) IF it is greater then the pass mark tell them they have passed
ELSE
tell them they have failed
3) thank them for using the system.
Passing mark being >= 40
- 03-01-2010, 08:40 PM #2
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
check that lineJava Code:{ public static void main (String[] args)Last edited by [RaIdEn]; 03-01-2010 at 11:41 PM.
- 03-01-2010, 11:36 PM #3
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Make the Button Work
By ŖàΫ ỏƒ Ңόρę in forum New To JavaReplies: 1Last Post: 02-27-2010, 10:52 AM -
[Help] setSize work wrong ???
By dawp in forum New To JavaReplies: 7Last Post: 11-05-2009, 09:30 AM -
Cannot make Java6 update10 work
By Sphacelaria in forum New To JavaReplies: 5Last Post: 12-01-2008, 03:48 AM -
Can't make JTable work -- please help!!
By cagalli83 in forum Advanced JavaReplies: 0Last Post: 02-13-2008, 09:31 AM -
To make work DLL from webservices
By Felissa in forum Advanced JavaReplies: 1Last Post: 07-05-2007, 07:07 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks