All might gurus of that which I don't understand-
I am a student and I am asking for some homework help (sorry, I am really stuck). I am getting a "C4430: missing type specifier - int assumed. Note: C++ does not support default-int" error, and for the life of me, I cannot figure it out. I have searched online and I am waiting for an email from my instructor, but if you guys could point me in the right direction (just explain the problem in n00b terms) I would be ever so thankful.
Ryan
int main()
{
int HourlyTemperatures[24];
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "This program runs on the 24 Hour Clock. Only enter whole hours for the time." << endl;
GetTemperatures(HourlyTemperatures);
average = ComputeAverageTemp(HourlyTemperatures);
cout << "Today's average temperature was: " << average << endl;
ComputeHiLowTemp(HourlyTemperatures);
high = HourlyTemperatures[23];
low = HourlyTemperatures[0];
cout << "Today's low temperature was: " << HourlyTemperatures[0] << endl;
cout << "Today's high temperature was: " << HourlyTemperatures[23] << endl;
return 0;
}
GetTemperatures(int HourlyTemperatures[])
{
// Get Temps
cout << "Hour Temperature" << endl;
for ( int i = 0; i < 24; i++ )
{
cout << i << ":00" << " ";
cin >> HourlyTemperatures[i];
}
return HourlyTemperatures[24];
}
ComputeAverageTemp(int HourlyTemperatures[])
{
// Find Average
int average;
for ( int i = 0; i < 24; i++ )
{
average = average + HourlyTemperatures[i];
}
average = average/24;
return average;
}
ComputeHiLowTemp(int HourlyTemperatures[])
{
// Find High/Low
int insert;
for ( int i = 1; i < 24; i++ )
{
insert = HourlyTemperatures[i];
int moveItem = i;
while (( moveItem > 0 ) && ( HourlyTemperatures[moveItem - 1] > insert ))
{
HourlyTemperatures[moveItem] = HourlyTemperatures[ moveItem-1];
moveItem--;
}
HourlyTemperatures[ moveItem ] = insert;
}
cout << "Today's low temperature was: " << HourlyTemperatures[0] << endl;
cout << "Today's high temperature was: " << HourlyTemperatures[23] << endl;
return HourlyTemperatures[0], HourlyTemperatures[23];
}