yes it does, and to print out the random number if the player loses would be the code below:
if(hasWon)
{
System.out.println("You win");
System.exit(0);
}
}...
Type: Posts; User: ATB
yes it does, and to print out the random number if the player loses would be the code below:
if(hasWon)
{
System.out.println("You win");
System.exit(0);
}
}...
sorry. im changing it again now i think this will be good
package assignment7;
import java.util.Scanner;
import java.util.Random;
public class Exercise1
to be honest i'm not sure what im doing but i think im missing something
here is the revised version
2759
what happens when i try to compile & run
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Duplicate local variable randomNumber
randomGenerator cannot be resolved...
hi! this is my first time one a forum and learning code, so please bear with me.
I was told to write a program which generates a random number between 0 to 5 *including 5*
and give the user 3...