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]
3 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]3 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
You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
AveGali [126]

Answer:

Page Layout is the correct answer of this question.

Explanation:

The Page Layout Tab includes most of the tools you need to organize your file pages only the direction we need them to. You can set borders, themes, monitor site alignment and scale, add sections and carriage returns, monitor line numbers, and adjust the protrusion and outlines for paragraphs.

On way to incorporate these enhancements is by using the Ribbon Borders, Font Shades, and Fill Color buttons in the Font section on the Page Layout tab.

8 0
3 years ago
What type of engineer works on cleaning up oil spills?
Margaret [11]

your answer is b. i know this because oil is a chemical.

7 0
3 years ago
Read 2 more answers
Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
bazaltina [42]

Answer:

A Background color

Explanation:

7 0
3 years ago
Write any two use of computer in school​
igomit [66]

Answer:

To solve mathmatical problem

To make questions paper

7 0
3 years ago
Yuri, a medical assistant, has been asked to send an account of a patient's last office visit to another doctor's office. The te
g100num [7]
The internet,,

To let the other doctor know about specific details on the patient, and other excessive information.

Hope this helps!! :)
6 0
3 years ago
Read 2 more answers
Other questions:
  • Select three examples of cryptographs. Security tokens Shared-key Malware Firewalls Message authentication code Public-key
    7·2 answers
  • How can you make a circle in JavaScript? Thank you!
    9·1 answer
  • Swiping and pinching are graphical user interface (gui) _____________.
    7·2 answers
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Your friend's job pays $5.00 per hour, and he works 20 hours per week. His tax rate is 20 percent. Assuming he works 50 weeks of
    11·2 answers
  • Why was the pilgrim's first corn crop such as successful one??
    7·1 answer
  • Name:
    11·1 answer
  • Which of the following is not true about variables
    8·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • Write an algorithm to verify a number as even​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!