JAVA Where is the problem in the following code sequence? The code is intended to generate random numbers between 1 and 10 until the number is either a 7 or a 5. Fix the problem. Random random = new...


JAVA



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


Random random = new Random();


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


while(number != 7 || number != 5)


{


number = 1 + random.nextInt(10);


}



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



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here