hajaghori hajaghori
  • 04-02-2021
  • Computers and Technology
contestada

write a method called threeHeads that repeatedly flips a coin until a coin

Respuesta :

hacker00100120
hacker00100120 hacker00100120
  • 04-02-2021

Answer:

public void threeHeads() {

Random r = new Random();

int count = 0;

while(count < 3) {

boolean head = r.nextBoolean();

if(head) {

System.out.print("H ");

count++;

} else {

System.out.print("T ");

count = 0;

}

}

System.out.println("\nThree heads in a row!");

}

Explanation:

Use GitHub

Answer Link

Otras preguntas

What is the unit force used in gravity calculations and why is it called this
Because increased fecundity means increased fitness, we might expect to observe the evolution of ever-increasing fecundity, but this is not the case. Which reas
How did Spain slowly gain control of land in Central and North America? by creating missions and forts to convert indigenous people to Christianity by developin
Explain the importance of ground tissue in plants?
help! which expression is equivalent to 14x + 35 - 21 y​
Read the summary of the article. Choose the answer that BEST goes into the blank to complete the summary. The mountainous terrain of Ancient Greece led to the c
im so lost im in algebra 1 and i feel so slow
Giving out brainliest!!
In general, what does it mean for a transformation to be a rigid motion? Explain.​
Burton Co. Requests assistance allocating costs and determining the profitability of its two departments: Skis and Snowboards. Shared indirect expenses include