You are to take the given code which shows 1 car running a race. Your job will be to add 5 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 to use Objects. Create an object capable of holding the information for each car. Also include 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. (Due note that credit for this objective will not be earned if you do not create and use objects for the car’s information.)
Objective 2 (25%):
Right now the race is only being run once. I want you to adjust the code so that the race can be run 25 times to simulate an entire season of racing. At the end of the season I want you to output each car’s race wins and finally display the car with the most wins as the season champion.
Objective 3 (25%):
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 straightaways or turns depending on your preference (so long as there is a chance of any type of racetrack being possible).*note that some cars are better than others and 1 or 2 of them are just awful and have no chance of winning – you do not have to balance it in any way, if 1 car wins every time that is fine (there will probably be some competition between at least 2 of them but again, it is not your job to balance the win rates).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here