Link to home
Start Free TrialLog in
Avatar of ca1358
ca1358

asked on

Learning Java TwoRandomTester

Any suggestions that would get this run , I would greatlya appreciated it.

To the expression generator.nextInt(n) will evaluate to a random integer between 0 and 1 less than n inclusive.

Determine which of the two randomly generated integers is the arger of the two and display it to the screen in a message:

"The larger of the number ____ and _____ is ____.

Output
Please enter a number of your choice.
100
The first random number picked was 13.
The second random number picked was 67
The larger of the numbers 13 and 67 was 67
**********************************************
package tworandomtester;
import java.util.Random;
import javax.swing.JOptionPane;

public class TwoRandomTester {

    public static void main(String[] args)
    {
       String input;
       
       Random generator = new Random();
       
       int randNum;
     
       input = JOptionPane.showInputDialog("Please enter a number of your choice");
        randNum = generator.nextInt(-1);
       
        JOptionPane.showMessageDialog(null, "The larger of the two numbers si that number");
    }

}
Avatar of sciuriware
sciuriware

NOW PLEASE DO YOUR HOMEWORK YOURSELF.

It is against the rules of Expert Exchange to probide you with all answers.

I do not need 'easy' points .....................
;JOOP!
Avatar of ca1358

ASKER

I am glad it is easy for you,  I have been at this for three days and approximately 8 hours per day on each one of these.  
Do not get me wrong.
We are just NOT allowed to do homework, we may help you to go further.
You are supposed to LEARN from this and to IMPROVE yourself.

But I see that you repeatedly ask the same questions.
By now you should know how to write output from a program.

;JOOP!
I think you are not learning from this way to ask questions, because you do
not have enough basic knowledge.
Therefore, please first take a basic course in JAVA fundamentals.

We all took that course some day in the past.

;JOOP!
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

ASKER

Thank you for the direction.