HELP NEEDED ASAP FOR HW! LANGUAGE JAVA Where is the problem in the following code sequence? The code is intended to generate random numbers between 1 and 20 until the number is either a 5 or a 10 or a...


HELP NEEDED ASAP FOR HW!


LANGUAGE JAVA



Where is the problem in the following code sequence? The code is intended to generate random numbers between 1 and 20 until the number is either a 5 or a 10 or a 15.


Random random = new Random();


int number = 1 + random.nextInt(20);


while(number != 5 || number != 10 || number != 15)


{


number = 1 + random.nextInt(20);


}




System.out.println("number is " + number);



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here