Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This part works. I was asked to use a couple more parameters i cannot figure out. public static void tournament(int percent, Random rand){ int wins1

This part works. I was asked to use a couple more parameters i cannot figure out.

public static void tournament(int percent, Random rand){

int wins1 = 0;

int wins2 = 0;

while (wins1 < wins2 + 10 && wins2 < wins1 + 10){

if (playoff(percent, rand)){ wins1++;

System.out.print(1);}

else{ wins2++;

System.out.print(2);}

}

We are being asked to re-write the code to use

while loop repeatedly calls Method1 assigning wins to

wins1 or wins2 in each iteration of the loop when the amount reaches either "wins" group having 10 more then the other the look should "break"

//while (true)

//check if the Math.abs(wins1 - wins2) is equal to 10, use the "break" statement to exit loop

// break;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Dr.br.ambedkar for the development views ?

Answered: 1 week ago

Question

Classify Various Phases of clinical Trials?

Answered: 1 week ago

Question

What is Foreign Policy?

Answered: 1 week ago