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
Choose the best answer from the options below to complete the following sentence.
Lemur [1.5K]

Answer:

its A. the answer to your question is preserved. :)

7 0
2 years ago
Mrs. Jackson wrote a newsletter to the customers of her housecleaning business that included some organizational tips they could
nika2105 [10]
The correct answer is a. effective communication

- - -
Ineffective and barriers to communication are problems that make communication unclear. Workplace communication is at work or at a job. This is not a job newsletter for workers, but for people at home.
5 0
3 years ago
Read 2 more answers
Select the online reading comprehension tool that best fits the description. This tool lets users change text from one language
Dmitrij [34]

Answer:

This tool lets users change text from one language to another.

translation tool

This tool helps users find definitions for difficult vocabulary.

online dictionary

This tool allows users to listen to passages of text that they select.

text-to-speech tool

This tool helps users memorize vocabulary by giving them representations of words using pictures.

flash cards

Explanation:

just did the assignment on edg 2020

7 0
2 years ago
Read 2 more answers
How much does 1 American tank cost on gas for a regular mission? Depending on your answer, I will give you the right amount of p
dem82 [27]
Most of the cars or other vehicles in the United States regularly have tanks that can hold up to 12 gallons worth of gas. The price of gas in not consistent. Sometimes prices are high and sometimes prices are low. Just like to day the price of a gallon is worth $2.2. But in an average, gas costs $3.8 per gallons. Therefore, on a regular basis a standard American which can hold 12 gallons costs $46.2.
5 0
3 years ago
When writing potential test questions, it is very important to use vocabulary words in their correct form. Please select the bes
Ilya [14]
The answer is True.

Hope I helped!
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following accurately completes this sentence? The Internet is ____.
    6·2 answers
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • Jenny wants to create a résumé after a two-years gap. What should she consider?
    11·2 answers
  • A digital designer might do computer animation or video games true or false
    13·2 answers
  • How do you copy and paste plz let me know
    14·2 answers
  • Claire wants to include animations in her presentation slides. Which element of the presentation programs interface will have th
    11·2 answers
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative numbe
    12·1 answer
  • (C) Describe about the different types of computer<br> peripherals and memory devices.
    9·1 answer
  • Can some one help me with this please
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!