STEP 1
Create a new project which consists of one class; the RacingData class.
The class should have data members that are used to represent the name of the player, the score achieved and the time (in both minutes and seconds) taken to achieve this score. The functions in the class should perform the following
• set the name, score and time
• return this same data
• print this data
Also add a default constructor and a constructor with parameters.
Operator Overloading: The class should have an additional function that overloads the + operator such that when used to add two objects it will add the scores of each object as well as the time to achieve these scores. It will not check that the names are the same. The result of adding two RacingData objects together should be another RacingData object with combined data. Write the complete implementation for this function.
STEP 2
Construct a main method so that it can test the class. This is to be done by creating six objects that are to represent two players each playing three games. Use the following data to construct the six objects:
Name Score Minutes Seconds
Danica Patrick 185 11 20
Danica Patrick 103 11 30
Danica Patrick 73 12 40
Jeff Gordon 155 10 10
Jeff Gordon 127 11 15
Jeff Gordon 34 12 35
USING THE OVERLOADED + OPERATOR, find the average score and time for each player and print out which performer had to lowest total time and which performer had the highest total score.
SAMPLE OUTPUT
Danica Patrick averaged a score of 120 in 11 minutes and 10 seconds.
Jeff Gordon averaged a score of 105 in 11 minutes and 0 seconds.
The performer with the highest score was: Danica Patrick scored a total of 361 points in a total of 35 minutes and 30 seconds.
The performer with the lowest time was: Jeff Gordon scored a total of 316 points in a total of 34 minutes and 0 seconds.