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
Your company has a team of remote workers that need to use Windows-based software to develop company applications, but your team
timofeeve [1]

Operating systems are the software that supports the basic functioning of the computer. Windows Virtual Desktop is an Azure compute service that will help solve the problem.

<h3>What is Windows Virtual Desktop?</h3>

Windows Virtual Desktop is an app virtualization service of Azure that operates on the cloud platform. It includes standard operating procedures that can be used by users with multiple OS.

Azure's Virtual Desktop supports different versions of window OS. This type of system is majorly used in remote work demands and specialized workloads.

Therefore, Windows Virtual Desktop is an Azure compute service.

Learn more about Azures service here:

brainly.com/question/13144160

#SPJ1

5 0
1 year ago
Read the following scenario, and then answer the question below.
shtirl [24]
Establish what skills are required to reach his goal
8 0
3 years ago
Read 2 more answers
Black box testing is the practice of writing tests without knowing the implementation of the code you're testing. White box test
Lelu [443]

Answer:

<u>First test:</u> Give a list of disordered numbers to the sorting algorithm an examine if the output is correctly sorted.

<u>Second test:</u> Give a list of ordered numbers to the sorting algorithm an analyze if the output is still correctly ordered.

<u>Third test:</u> Give a list of ordered numbers and some non-numeric values to the sorting algorithm and check how is managed the exception in case of error or if the output is correctly ordered.

6 0
3 years ago
How does soil lose its value? A.When the top soil is stripped by wind or water B.When the bedrock is damaged by animals C.When w
Ratling [72]

A) when the soil is stripped by wind or water.. when this happens the soil can be rid of it's nutrients and fertility.. The other options are actually kind of helpful, when the bedrock is damaged by animals (unless you've already set up and everything) it actually helps to till the soil, the water will help to moisten it and make it better or providing life (depending upon the amount of water tht is) and burrowing animals can consist of worms to groundhogs.. depending upon the plans for said soil, It could be helpful with the worms, but the plans could be altered by the groundhog.. but referring to the original question, It definitely  loses it's value when it's stripped by wind and water. 
8 0
3 years ago
You should see the following code in your programming
Karo-lina-s [1.5K]

Answer:

import simplegui

import random

def draw_handler(canvas):

for x in range(1000):

colorList = ["Yellow", "Red", "Purple", "White", "Green", "Blue", "Pink", "Orange"]

c = random.choice(colorList)

x = random.randint(1,600)

y = random.randint(1,600)

canvas.draw_point([x, y], c)

frame = simplegui.create_frame('Testing', 600, 600)

frame.set_canvas_background("Black")

frame.set_draw_handler(draw_handler)

frame.start()

Explanation:

I used a for loop, setting my range to 1000 which is how you create exactly 1000 points. Next, I defined my color array, my x randint value, and my y randint value. I set both the x and y randint values to 1 - 600 since the frame is 600x600. The rest is pretty self explanatory.

4 0
2 years ago
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • . Hackers generally disguise their IP address. True False
    9·1 answer
  • Face book requires you to change your password regularly<br> a. TRUE<br> b. FALSE
    14·1 answer
  • Write a method called makeLine. The method receives an int parameter that is guaranteed not to be negative and a character. The
    11·1 answer
  • Which type of computer operating system would be best for a large corporation?
    7·2 answers
  • Please help again if anyone doesn't mind
    15·1 answer
  • lance measured 0.485 liter of water. Angel measured 0.5 liter of water. lance said, "My beaker has more water than yours because
    6·2 answers
  • How much time per day does the average U.S. youth spend watching television, playing video games, or using a computer?
    8·1 answer
  • You want to use a terminal program to terminal into a cisco router. what protocol should i use
    8·1 answer
  • The residual volume can be measured directly with: Select an answer and submit. For keyboard navigation, use the up/down arrow k
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!