Archives from S:\ Drive

Good to keep around methinks
This commit is contained in:
Amrit Panesar committed 2015-04-01 21:23:15 -07:00
1 parent eadaf70b9e
commit 6dd63cc439
606 files changed
+50212

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
import javax.swing.*;
public class PosNegZed
{
public static void main(String[] args) //main
{
String input = JOptionPane.showInputDialog("Please enter a whole number.");
int iInt01 = 0;
try
{
iInt01 = Integer.parseInt(input);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(null, "We're sorry, \""+input+"\" was"
+ " an incorrect input.", "Error", JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
if (iInt01 > 0)
{
JOptionPane.showMessageDialog(null, "\""+input+"\" is positive.",
"Thank You", JOptionPane.INFORMATION_MESSAGE);
}
else if (iInt01 < 0)
{
JOptionPane.showMessageDialog(null, "\""+input+"\" is negative.",
"Thank You", JOptionPane.INFORMATION_MESSAGE);
}
else if (iInt01 == 0)
{
JOptionPane.showMessageDialog(null, "\""+input+"\" is zero.",
"Thank You", JOptionPane.INFORMATION_MESSAGE);
}
System.exit(0);
}
}