Question: In Java: Generate random numbers between 11 and 25 (inclusive) and print them until the number 13 is generated. At that point no more random

In Java:

Generate random numbers between 11 and 25 (inclusive) and print them until the number 13 is generated. At that point no more random numbers should be generated.

Do not print 13. Instead print in a separate line all done

Dont print 20. If the number 20 is generated print two at signs @@ instead

Use a single space (blank) to separate the numbers / at signs (see sample output)

Print no more than 5 numbers in a single line. Every time 5 numbers have been printed start a new line. (if it takes 4 random numbers to get 13 only one line will be printed. If it takes 11 times to get 13 three lines will be printed etc.)

Notice: because the numbers are random your output might look different from mine

Sample Output:

22 @@ 18 12 25

12 22 24 25 24

24 22 22 24

all done

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!