I have 3 files of a Rainfall/Stats class and I am having problems with array, it is not getting the input and making the total,average,etc not work and giving them 0's or garbage.
I will appreciate any help and thanks in advance.
#include "Stats.h"
#include <iostream>
usingnamespace std;
constint MONTHS = 12;
int main()
{
Stats raindata;
double rain;
cout << "Enter the data for each the month."<<endl;
for(int index = 0; index < MONTHS; index++)
{
cout << "Month " <<(index +1) << ": ";
cin >>rain;
raindata.setValue(index, rain);
}
cout << "Total amount of Rain is " << raindata.getTotal() <<endl
<< "Average amount of Rain is " << raindata.getAverage() <<endl
<< "The Max amount of rain was " <<raindata.getMax() <<endl
<< "The Mininum amount of rain was " <<raindata.getMin() <<endl;
system("pause");
return 0;
}