So I finished my code, however, it doesn't seem right to me and there may be something off with the Average Times. I need another set of eyes to see if the average time makes sense in the display function. It works just fine but something seems off and I can't quite catch it. Any assistance would be much appreciated. This display function is utilized as a FRIEND function.
void display(RacingData& Avg, RacingData& AVG)
{
cout << "*****Racer Average Score & Time***** " << endl << endl;
cout << " Danica's Average Score is " << Avg.score/3 << endl;
if (Avg.seconds >= 60)
{
Avg.minutes += Avg.seconds /60;
Avg.seconds = Avg.seconds % 60;
cout << " Danica's Average Time is " << Avg.minutes/3 << " Minutes " << Avg.seconds/3 << " Seconds " << endl << endl;
}
cout << " Jeff's Average Score is " << AVG.score/3 << endl;
if (AVG.seconds >= 60)
{
AVG.minutes += AVG.seconds / 60;
AVG.seconds = AVG.seconds % 60;
cout << " Jeff's Average Time is " << AVG.minutes/3 << " Minutes " << AVG.seconds/3 << " Seconds " << endl << endl;
}
cout << "*****Racer Results***** " << endl << endl;
if (Avg.score > AVG.score)
{
cout << " The Highest TOTAL Score: " << Avg.name << endl << endl;
}
else
{
cout << " The Highest TOTAL Score: " << AVG.name << endl << endl;
}
if (Avg.minutes && Avg.seconds > AVG.minutes && AVG.seconds)
{
cout << " The Lowest TOTAL Time: " << Avg.name << endl << endl;
}
else
{
cout << " The Lowest TOTAL Time: " << AVG.name << endl << endl;
}