Question: Problem B . ( 1 0 points ) Boat Race Define a class named BoatRace that contains the following information about a Boat Race: race
Problem B points Boat Race
Define a class named BoatRace that contains the following information about a Boat Race:
racename : string
raceid: int
distance: int
racers: List of Boat objects
Write a constructor init that allows the programmer to create an object of type BoatRace with a racename, raceid list of racers objects, and distance.
The constructor will only take in one parameter other than self a string representing the name of a CSV file. The file will have the following format:
Each row will always have exactly two columns.
The first row will always contain the name of the race.
The second row will always contain the id number for the race.
The third row will always contain the distance for the race.
All remaining rows contain information about the boats involved in the race: the first column will be the name of the boat, and the second column is that boat's top speed. For example, the race in the file below has two boats: The Fire Ball with top speed and The Leaf with top speed
Name, The Big One
ID
Distance,
The Fire Ball,
The Leaf,
The constructor must read the information from the file and use it to initialize the appropriate instance variables. Keep in mind that the race id and distance for the
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
