use file TwoRandom.java
Write a Java program that generates two “random” integers using the method Math.random(), each between 1 and 7 (inclusive). Your program should output the two numbers, and one of the following three messages:
• A tie!
• You lose!
• You win!
if the difference between the numbers is zero
if the difference between the numbers is 1, 3, or 5 if the difference between the numbers is 2, 4, or 6
Attachments
No attachments uploaded
Tags
Clarifications
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'cramshark'; // required: replace example with your forum shortname
var disqus_identifier = '/production/1606';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
Please enable JavaScript to view the comments powered by Disqus.

Below the solution for this assignment.
Attachments
No screenshots uploaded

TwoRandom.java (1 K)
Preview

Screenshots
number2 = 1 + (int) (Math.random() * ((7 - 1) + 1));
int difference = Math.abs(number1 - number2);
if (difference ==