Question: What input was given to the following code snippet to output 2 ? Scanner s = new Scanner ( System . in ) ; int
What input was given to the following code snippet to output
Scanner s new ScannerSystemin;
int times;
times snextInt; brings in an int from commandline
times times times : times;
Objective :
You are to take the given code which shows car running a race. Your job will be to add more cars with varying stats which should participate in the race just like the first car. In this lab each car holds the same types of information, behaves in the same way and only differs in their values for said information. So the optimal solution would be an object to hold the cars information as well as the behaviors the car undertakes. Create an object capable of holding the information for each car. Include also the operations that the cars do as methods functions Make certain to create a constructor that takes, as input, adequate information to allow you to build the cars more easily.
String carName "Pat Sajak Car";
carHandlingS f;
carHandlingC f;
carHandlingU f;
carRaceProgress ;
carCurrentSpeed ;
carTopSpeed f;
carAcceleration f;
carWins ;
carSymbol P;
String carName "Alex Trebek Car";
carHandlingS f;
carHandlingC f;
carHandlingU f;
carRaceProgress ;
carCurrentSpeed ;
carTopSpeed f;
carAcceleration f;
carWins ;
carSymbol A;
String carName "Bob Eubanks Car";
CarHandlingS f;
CarHandlingC f;
CarHandlingU f;
CarRaceProgress ;
CarCurrentSpeed ;
CarTopSpeed f;
CarAcceleration f;
CarWins ;
CarSymbol D;
String carName "Steve Harvey Car";
CarHandlingS f;
CarHandlingC f;
CarHandlingU f;
CarRaceProgress ;
CarCurrentSpeed ;
CarTopSpeed f;
CarAcceleration f;
CarWins ;
CarSymbol H;
String carName "Richard Dawson Car";
CarHandlingS f;
CarHandlingC f;
CarHandlingU f;
CarRaceProgress ;
CarCurrentSpeed ;
CarTopSpeed f;
CarAcceleration f;
CarWins ;
CarSymbol R;
Objective :
Right now the race is only being run once. Adjust the code so that the race can be run times to simulate an entire season. At the end of the season the car with the most wins should be output along with the race wins total.
Objective :
Each race of the season should be a different race. Randomly create racetracks prior to the start of each race. Do this by randomly appending the four characters to a string. You can skew the random numbers to give more straitaways or turns depending on your preference so long as there is a chance of any type of race track being possible int notes times;
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
