Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started