The high school driving instructor wants to predict where students on the driving course are. The course is an oval with three segments, each 1 mile long. Each segment has a different speed limit: 20 mph, 60 mph, and 30 mph respectively. Our driver starts at zero mph at the start of the first segment and accelerates (at 15f/s/s, or 10.23mph/s) up to 20mph. At the start of the second segment, our driver accelerates again to 60 mph. Our driver slows down so that she is driving 30mph at the start of the third segment. Write a program that prints the location (distance from start), speed, and time every 30 seconds for each of three cars starting 1 minute apart based on this model. Report speed and location in miles/hour and miles.

Your output should look something like

Time car A car B car C
speed location speed location speed location
0.0 0.0 0.0 0.0 0.0 0.0 0.0
30.0 20.0 0.16 0.0 0.0 0.0 0.0
...

Create a class Car. Create an instance of this class for each car on the course. Your main in the Car class should produce the output for the three cars given above. (That is, I should be able to compile and run your Car.java code, and without further input, the table will be generated.)

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.