Codemoji

Your code ยท JAVA

Java runs on a computer with a JDK - the steps are the check.

Type public int findFifty(){

Notes

Java can't compile in the browser - read the steps and type the code into the editor. Run it on your own machine when you're ready (any IDE with a JDK works).

Reference

public int findFifty(){
double num = Math.random();
num = num * 100;
int maybeFifty = Math.floor(num);
return maybeFifty;
}
int number = findFifty();
while(number != 50){
System.out.println(number);
number = findFifty();
}
System.out.println(number);