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
This is not a feature provided by most GUIS.<br> icons<br> windows<br> forms<br> menus
Murrr4er [49]
Maybe menus I’m not sure but good luck
5 0
3 years ago
Read 2 more answers
We can use formatting before and after typing.​
Anika [276]

Answer:

i dont know but thanks for marks

8 0
3 years ago
Which of the following is a hardware component used to hold the BitLocker encryption key and ensures encrypted data is not acces
Vadim26 [7]

Answer:

TPM(Trusted Platform Module) is the correct answer to the following question.

Explanation:

Because TPM is the computer chip which protects your system data and store all keys and access of data that is encrypted by these keys. So that's why TPM is that hardware component which is used to contain the encryption keys and that data is not accessible to any other person's whether your hard drive will be lost or stolen by anyone.

6 0
3 years ago
What does my name look like in binary code, btw my mane is Wendy Alexis Morales
jekas [21]
01010111 01100101 01101110 01100100 01111001 00100000 01000001 01101100 01100101 01111000 01101001 01110011 00100000 01001101 01101111 01110010 01100001 01101100 01100101 01110011
6 0
3 years ago
Read 2 more answers
Periodically adding, changing and deleting file records is called file. A) Updating B) Upgrading C) Restructuring D) Renewing E)
igomit [66]
Periodically adding, changing and deleting file records is called file updating. The correct answer is A. 
4 0
4 years ago
Read 2 more answers
Other questions:
  • A(n) ____________________ is a set of programs that coordinates all the activities among computer or mobile device hardware.
    10·1 answer
  • FTP requires confirmation that a file was successfully transmitted to a client, but it has no built-in mechanism to track this i
    7·2 answers
  • What is an example of how pseudo - randomness is used to creative variation​
    5·1 answer
  • In order to do a binary search on an array Group of answer choices you must first do a sequential search to be sure the element
    5·1 answer
  • A small but growing advertising business hires a new secretary. Until now, the computers have been directly connected, and all t
    12·1 answer
  • Advantages of Linux include_____.
    6·1 answer
  • PLZ HELP! ANSWER (WITH CORRECT ANSWER AND EXPLANATION THAT ACTUALLY IS CORRECT) GETS BRAINLIEST!
    13·1 answer
  • 10010 - 1011 binary subtraction​
    5·1 answer
  • What can be done to solve unemployment problem?​
    11·1 answer
  • Examine the following output:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!