ca1358
asked on
java if staatement
I am determine which of the two randomly generated integers is the larger of the two and display it to the scree in the last JOption statement.
JOptionPane.showMessageDia log(null, "The larger of the two numbers " + (value) + " and " + num + " is ");
any help would greatly be appreciated.
************************** ********** **
package randomtester;
import java.util.Random;
import javax.swing.JOptionPane;
public class Main
{
public static void main(String[] args)
{
String input;
Random generator = new Random();
int num;
num = generator.nextInt(100);
int value;
input = JOptionPane.showInputDialo g("Please enter a number of your choice");
// value = Double.parseDouble(input);
value = Integer.parseInt(input);
JOptionPane.showMessageDia log(null, "The First random number picked was " + (value));
JOptionPane.showMessageDia log(null, "The second random number picked was " + (num));
JOptionPane.showMessageDia log(null, "The larger of the two numbers " + (value) + " and " + num + " is ");
}
}
JOptionPane.showMessageDia
any help would greatly be appreciated.
**************************
package randomtester;
import java.util.Random;
import javax.swing.JOptionPane;
public class Main
{
public static void main(String[] args)
{
String input;
Random generator = new Random();
int num;
num = generator.nextInt(100);
int value;
input = JOptionPane.showInputDialo
// value = Double.parseDouble(input);
value = Integer.parseInt(input);
JOptionPane.showMessageDia
JOptionPane.showMessageDia
JOptionPane.showMessageDia
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome!
ASKER