1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Allushta [10]
2 years ago
12

Create a method called randomValues that uses a while loop to generate a random number between 1-25 until the value 10 is genera

ted. Therefore, 10 will be the value that stops your loop from generating a random number.
Computers and Technology
1 answer:
ahrayia [7]2 years ago
3 0

Answer:

The method in Java is as follows:

public static void randomValues(){

    Random r = new Random();

    int sentinel = 10;

    int randNum = r.nextInt(24) + 1;

    while(randNum!=sentinel){

        System.out.print(randNum+" ");

        randNum = r.nextInt(24) + 1;

    }

    System.out.print(sentinel);

}

Explanation:

This defines the method

public static void randomValues(){

This creates a random object, r

    Random r = new Random();

This sets the sentinel value to 0

    int sentinel = 10;

This generates a random number

    int randNum = r.nextInt(24) + 1;

This loop is repeated until the the random number is 10

    while(randNum!=sentinel){

Print the generated number

        System.out.print(randNum+" ");

Generated another random number

        randNum = r.nextInt(24) + 1;     }

Print the sentinel (i.e. 10)

    System.out.print(sentinel);

}

You might be interested in
Write the Q basic program to find the area of room.​
Mkey [24]

Explanation:

CLS

Input length

Input breadth

A= l*b

Print" the area of a room is"; A

END

8 0
2 years ago
Search engine ranking evaluates the variables that search engines use to determine where a URL appears on the list of search res
VARVARA [1.3K]

Answer:

True.

Explanation:

Search engines are evaluated on the basis of the variables which are used by the search engines to determine where the URL appears in the list of the search results.There are certain algorithms are also implemented using these variables like panda algorithm.So we conclude that the answer is True.

3 0
3 years ago
My computer screen keeps flashing black, it's on a very low brightness level and I very rarely put it up to high level unless I
mihalych1998 [28]
If your computer is old it may be the screen is dying or if its brand new it would probably  be the power supply check your battery or cables
6 0
3 years ago
Read 2 more answers
What year did polaroid introduce one-step photography with the SX-70
blagie [28]

Answer:

I first saw the Polaroid SX-70—the one-step instant camera introduced in 1972 by the company's co-founder, Dr.

Explanation:

5 0
2 years ago
Who invented Satellites? What purpose does it serve? How has it impacted society today?
noname [10]

Answer:

Satellites have changed the way we experience the world, by beaming back images from around the globe and letting us explore the planet through online maps and other visuals. Such tools are so familiar today we often take them for granted. ... Satellites often offer hints about life on the ground, but not omniscience.

5 0
2 years ago
Read 2 more answers
Other questions:
  • How can you recognize an unsecured wireless network?
    9·1 answer
  • Do you think engineers have to adapt their original plans during the construction of systems or products? Why might they?
    6·1 answer
  • You've been asked to find the largest number in a range of numbers. Which of the following could you use to find the largest num
    8·1 answer
  • to the nearest millimeter a cell phone is 123 long and 54 mm wide what is the ratio of width to length
    12·1 answer
  • How does technology make America great?​
    10·1 answer
  • What are the consequences of plagiarism?
    7·2 answers
  • An example of creative curating is when a:
    9·1 answer
  • PLZ ANSWER THESE QUESTIONS FOR 30 POINTS AND BRAINLIEST!
    9·1 answer
  • Which of the following file formats cannot be imported using Get & Transform?
    6·1 answer
  • When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!