Hello!!! Im posting this because im having an issue with my program, see below. The problem im having are errors with my function calls saying the compiler cant convert my functions to the arguments in my function definitions after my return 0; statement. I think the rest of my code should work, but I dont know what to do about the errors.Fairly new to C++, so excuse my mistakes. Thanks for any help that can be provided, and thanks for your time.
return 0;
}
void fillArray(cyclistType cyclistInfo[size])//Function to fill array.
{
int i;
for(i=0; i<12; i++)
{
cout <<"Please enter the cyclist's last name, cyclist number, and how many";
cout <<"miles they have ridden :" << endl;
cin >> cyclistInfo[i].cyclistL >> cyclistInfo[i].cyclistNum;
cin >> cyclistInfo[i].milesRidden;
}
}
void printArray(cyclistType cyclistInfo[size])//Function to output info.
{
int i;
for(i=0; i<12; i++)
cout << cyclistInfo[i].cyclistNum <<" " <<cyclistInfo[i]. cyclistL << " ";
cout << cyclistInfo[i].milesRidden << endl;
}
void totalMiles(cyclistType cyclistInfo[size], int total)Function that adds all of the cyclist's miles ridden together and outputs a combined number.
{
int i;
for(i=0; i<12; i++)
{
total = total + cyclistInfo[i].milesRidden;
}
cout <<" The combined amount of miles ridden by all cyclists is:" << total;
cout << endl;
}
int mostMiles(cyclistType cyclistInfo[size], int max)//Function to out the rider with the most miles and his cyclist number.
{
int i;
for(i=0; i<12; i++)
if(cyclistInfo[i].milesRidden < cyclistInfo[i].milesRidden)
max = i;
cout <<" The cyclist with the must miles ridden was :" << cyclistInfo[max].milesRidden;
cout <<"and he rode for " << max << " miles. " << endl;
#include <iostream>
#include <string>
#include <iomanip>
usingnamespace std;
constint SIZE = 12;
struct cyclistType
{
string cyclistL;
int cyclistNum;
int milesRidden;
};
cyclistType cyclistInfo[SIZE];
void fillArray(cyclistType cyclistInfo[]);
void printArray(cyclistType cyclistInfo[]);
void totalMiles(cyclistType cyclistInfo[], int total);
void mostMiles(cyclistType cyclistInfo[], int max);
int main()
{
int total = 0;
int max = 0;
fillArray(cyclistInfo);
printArray(cyclistInfo);
totalMiles(cyclistInfo, total);
mostMiles(cyclistInfo, max);
system("pause");
return 0;
}
void fillArray(cyclistType cyclistInfo[])//Function to fill array.
{
int i;
for(i=0; i<12; i++)
{
cout <<"Please enter the cyclist's last name, cyclist number, and how many";
cout <<"miles they have ridden :" << endl;
cin >> cyclistInfo[i].cyclistL >> cyclistInfo[i].cyclistNum;
cin >> cyclistInfo[i].milesRidden;
}
}
void printArray(cyclistType cyclistInfo[])//Function to output info.
{
int i;
for(i=0; i<12; i++)
cout << cyclistInfo[i].cyclistNum <<" " <<cyclistInfo[i]. cyclistL << " ";
cout << cyclistInfo[i].milesRidden << endl;
}
void totalMiles(cyclistType cyclistInfo[], int total)//Function that adds all of the cyclist's miles ridden together and outputs a combined number.
{
int i;
for(i=0; i<12; i++)
{
total = total + cyclistInfo[i].milesRidden;
}
cout <<" The combined amount of miles ridden by all cyclists is:" << total;
cout << endl;
}
void mostMiles(cyclistType cyclistInfo[], int max)//Function to out the rider with the most miles and his cyclist number.
{
int i;
for(i=0; i<12; i++)
if(cyclistInfo[i].milesRidden < cyclistInfo[i].milesRidden)
max = i;
cout <<" The cyclist with the must miles ridden was :" << cyclistInfo[max].milesRidden;
cout <<"and he rode for " << max << " miles. " << endl;
}
//end main