Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ADVANCED PROGRAMMING TECHNIQUES
PROGRAMMING ASSIGNMENT 5
Need for Speed
Objective
The goal of this assignment is to provide practice with interactions between several objects, to interact with a logger class, and to start to learn how to test your code.
The implementation of this assignment should NOT use any inheritance.
Description
You have been hired by Mohammadi Gaming to write a racecar simulation.
The objective of this simulation is to see the number of points that can be accumulated with a selection of racecars of different characteristics (speed and ability to handle collisions, etc.). One can run the game multiple times, see the number of points produced each time, and identify the selection of cars that may maximize the number of points. It is much more efficient to use a simulation instead of actual cars to evaluate these design tradeoffs.
Assume that each car has two adjustable characteristics- Strength and Speed - which determines a car's behavior. during a race. There are tradeoffs: a car with high speed races faster but takes more damage during a collision, while a slower car takes less damage in a collision.
Once a car enters the race, it moves along the track in periods called “ticks.” Each tick moves the cara fixed distance which is equal to its Speed stat.
Each lap is 100 units (a unit is a measure of simulated distance on the track). Once a car reaches 1000 units (10 laps of 100 units), it enters the finish line and exits the race.
Anytime two cars finish a tick at the same location, they collide and become damaged (remember that 2 cars in the same location on different laps still collide). Collision damage results in a penalty to your speed that is equal to your Strength level multiplied by five. (Cars do NOT take stacking damage penalty. This means that if a car is already damaged, it will NOT have a further reduction of speed in a second collision.)