You will get email Reply within few hours

Saturday 17 August 2013

NASCAR

My question wouldn't fit in the first box so it's here: Problem B: NASCAR Define a class called Car with the following attributes: • Total Odometer Miles • Speed in miles per hour • Driver Name • Sponsor The total odometer miles should be initialized to zero, and speed initialized to a random value between 1 and 120. Create a list of 20 vehicles with random (or real) driver and sponsor names. Your main program should simulate the progress of the vehicles in the race. Every minute, the vehicles
NASCAR
Define a class called Car with the following attributes:
• Total Odometer Miles
• Speed in miles per hour
• Driver Name
• Sponsor
The total odometer miles should be initialized to zero, and speed initialized to a random value between 1 and 120.
Create a list of 20 vehicles with random (or real) driver and sponsor names.
Your main program should simulate the progress of the vehicles in the race. Every minute, the vehicles pick a new random speed, and their odometer miles are updated every minute using this equation:
• odometer_miles = odometer_miles + speed * time
Since speed is in miles per hour, time should be in hours as well (1 minute is 1/60th of an hour).
The first car to reach 500 miles should be declared the winner by printing the driver name and sponsor name.
Include any useful methods in your class definition that you see fit.

Need Solution Email me: topsolutions8@gmail.com