Question: import java.util.Random; public class Main { public static void main ( String [ ] args ) { Random rand = new Random ( ) ;
import java.util.Random;
public class Main
public static void mainString args
Random rand new Random;
System.out.printEnter player name: ;
String playername System.consolereadLine;
System.out.printEnter player max steps: ;
int playermaxsteps Integer.parseIntSystemconsolereadLine;
System.out.printEnter player name: ;
String playername System.consolereadLine;
System.out.printEnter player max steps: ;
int playermaxsteps Integer.parseIntSystemconsolereadLine;
System.out.printDo you want to play a regular step game or a different number of steps? different;
String choice System.consolereadLine;
if choiceequals
PlayGameplayername, playermaxsteps, playername, playermaxsteps;
else
System.out.printEnter the number of steps to cross the finish line: ;
int finishLine Integer.parseIntSystemconsolereadLine;
PlayGameplayername, playermaxsteps, playername, playermaxsteps, finishLine;
public static void PlayGameString playername, int playermaxsteps,
String playername
The class name in the OverLoad should be Overload as Java's source file name should be exact same as its first public class. You should have the parameter method and parameter method PlayGame define inside the class Overload.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
