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
On a router configured to use RIP, the number of routers a packet must travel between before it reaches its destination is calle
11111nata11111 [884]

Answer:

metric

hop count

Explanation:

6 0
3 years ago
Discuss the software development methodology you would use for developing a software product for insurance agents, and state val
nadya68 [22]

Answer:

It depends on what the company will be willing to use and it also depends on their budget

Explanation:

4 0
3 years ago
What do the last two steps in the cyclical design process most likely involve
zlopas [31]

Answer:

Well you would want to test the design, so it would be "c" then "d"

Explanation:

I hope this helps.

8 0
2 years ago
Under which jeys do the page up and page down keys fall under
Mademuasel [1]

Answer:

Page up(PgUp) and Page down(PgDn) keys fall under the navigation keys.

Explanation:

Page up(PgUp) and Page down(PgDn) keys fall under the navigation keys.

They include the four Arrow keys, Page Up, Page Down, Home and End keys.

<u>Arrow Keys:</u>

One of four computer keys marked with an up, down, left, or right arrow, used for moving the cursor.

<u>Page Up and Page down:</u>

Page Up and Page Down keys abbreviated as PgUp and PgDn are two keys commonly found on computer keyboards. The two keys are used to scroll up or down in documents.

<u>Home Key:</u>

The Home key is used to return the typing cursor to the beginning of the line on which you are currently typing.

<u>End Key:</u>

The end key is opposite to home key. It is used to return the typing cursor to the end of the line on which you are currently typing....

4 0
3 years ago
Ventaja que implica usar funciones en las hojas de calculo
lys-0071 [83]

Answer:

Explanationeeigrtghh:

baba booey

8 0
3 years ago
Other questions:
  • What advantage do ExpressCard modules and U.S.B adapters offer over expansion cards?
    10·1 answer
  • Plz help ASAP
    10·1 answer
  • What is a help desk
    15·1 answer
  • What function would you use to find the mean in a Microsoft excel document ?
    6·2 answers
  • im in honors comupter science and one of my questions is evaluate 18% 7 does anyone know how to answer that
    6·1 answer
  • What is the root of the tree?
    6·1 answer
  • Consider the following schema for customer: (id, name, street, city, state, zip, phone), in which customers are uniquely determi
    10·1 answer
  • Which format of image files can be inserted in html?​
    8·2 answers
  • Drag each tile to the correct box.
    9·2 answers
  • What command utilizes the limpel-ziv (lz77) compression algorithm and achieves a compression ratio of 60-70 percent?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!