ou 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.) String car2Name = "Pat Sajak Car"; car2HandlingS = 0.45f; car2HandlingC = 0.65f; car2HandlingU = 0.3f; car2RaceProgress = 0; car2CurrentSpeed = 0; car2TopSpeed = 0.83f; car2Acceleration = 0.14f; car2Wins = 0; car2Symbol = 'P';   String car3Name = "Alex Trebek Car"; car3HandlingS = 0.29f; car3HandlingC = 0.45f; car3HandlingU = 0.02f; car3RaceProgress = 0; car3CurrentSpeed = 0; car3TopSpeed = 0.85f; car3Acceleration = 0.19f; car3Wins = 0; car3Symbol = 'A';   String car4Name = "Bob Eubanks Car"; Car4HandlingS = 0.15f; Car4HandlingC = 0.18f; Car4HandlingU = 0.05f; Car4RaceProgress = 0; Car4CurrentSpeed = 0; Car4TopSpeed = 0.89f; Car4Acceleration = 0.21f; Car4Wins = 0; Car4Symbol = 'E';   String car5Name = "Monty Hall Car"; Car5HandlingS = 0.18f; Car5HandlingC = 0.22f; Car5HandlingU = 0.09f; Car5RaceProgress = 0; Car5CurrentSpeed = 0; Car5TopSpeed = 0.93f; Car5Acceleration = 0.17f; Car5Wins = 0; Car5Symbol = 'M';   String car5Name = "Richard Dawson Car"; Car5HandlingS = 0.40f; Car5HandlingC = 0.5f; Car5HandlingU = 0.35f; Car5RaceProgress = 0; Car5CurrentSpeed = 0; Car5TopSpeed = 0.815f; Car5Acceleration = 0.19f; Car5Wins = 0; Car5Symbol = 'R';   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).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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.)

  • String car2Name = "Pat Sajak Car";
  • car2HandlingS = 0.45f;
  • car2HandlingC = 0.65f;
  • car2HandlingU = 0.3f;
  • car2RaceProgress = 0;
  • car2CurrentSpeed = 0;
  • car2TopSpeed = 0.83f;
  • car2Acceleration = 0.14f;
  • car2Wins = 0;
  • car2Symbol = 'P';

 

  • String car3Name = "Alex Trebek Car";
  • car3HandlingS = 0.29f;
  • car3HandlingC = 0.45f;
  • car3HandlingU = 0.02f;
  • car3RaceProgress = 0;
  • car3CurrentSpeed = 0;
  • car3TopSpeed = 0.85f;
  • car3Acceleration = 0.19f;
  • car3Wins = 0;
  • car3Symbol = 'A';

 

  • String car4Name = "Bob Eubanks Car";
  • Car4HandlingS = 0.15f;
  • Car4HandlingC = 0.18f;
  • Car4HandlingU = 0.05f;
  • Car4RaceProgress = 0;
  • Car4CurrentSpeed = 0;
  • Car4TopSpeed = 0.89f;
  • Car4Acceleration = 0.21f;
  • Car4Wins = 0;
  • Car4Symbol = 'E';

 

  • String car5Name = "Monty Hall Car";
  • Car5HandlingS = 0.18f;
  • Car5HandlingC = 0.22f;
  • Car5HandlingU = 0.09f;
  • Car5RaceProgress = 0;
  • Car5CurrentSpeed = 0;
  • Car5TopSpeed = 0.93f;
  • Car5Acceleration = 0.17f;
  • Car5Wins = 0;
  • Car5Symbol = 'M';

 

  • String car5Name = "Richard Dawson Car";
  • Car5HandlingS = 0.40f;
  • Car5HandlingC = 0.5f;
  • Car5HandlingU = 0.35f;
  • Car5RaceProgress = 0;
  • Car5CurrentSpeed = 0;
  • Car5TopSpeed = 0.815f;
  • Car5Acceleration = 0.19f;
  • Car5Wins = 0;
  • Car5Symbol = 'R';

 

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).

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY