Problem B. (10 points) Boat Race
Define a class named BoatRace that contains the following information about a Boat Race:
race_name: string
race_id: int
distance: int
racers: List of Boat objects
Write a constructor that allows the programmer to create an object of type BoatRace with a race_name, race_id, list of racers objects, and distance.The constructor will only take in one parameter, 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 12, and The Leaf with top speed 100.
Name,The Big One
ID,11
Distance,120
The Fire Ball,12
The Leaf,100
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 race should be converted to an integer, as should the top speed for each boat.
The racers instance variable is a list of Boat objects. This means that you will need to use the Boat constructor from problem A to create a Boat object from the information in each row past the third.
Provide a getter for the following instance variables with no input parameters (other than self) passed in:
get_race_name returns the race_name
get_race_id returns the race_id
get_distance returns the distance
get_racers returns the racers