What message will the following program display if the user enters 5? What if the user enters 10? What if the user enters 100?
import javax.swing.JOptionPane;
public class Checkpoint
{
public static void main(String[] args)
{
String input;
int number;
input = JOptionPane.showInputDialog("Enter a number.");
number = Integer.parseInt(input);
if (number < 10)
method1();
else
method2();
System.exit(0);
}
public static void method1()
{
JOptionPane.showMessageDialog(null, "Able was I.");
}
public static void method2()
{
JOptionPane.showMessageDialog(null, "I saw Elba.");
}
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.