Link to home
Start Free TrialLog in
Avatar of ca1358
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.showMessageDialog(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.showInputDialog("Please enter a number of your choice");
  //  value = Double.parseDouble(input);
     value = Integer.parseInt(input);
     
     JOptionPane.showMessageDialog(null, "The First random number picked was " + (value));
     JOptionPane.showMessageDialog(null, "The second random number picked was " + (num));
     
     
         
     JOptionPane.showMessageDialog(null, "The larger of the two numbers " + (value) + " and " + num + " is ");
    }

}
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ca1358
ca1358

ASKER

Thank you!
You are welcome!