These are two ways I have decided to approach the problem.
1) #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
const int noOfMonths = 12;
enum month{Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};
struct MonthlyRec
{
double RainFall;
double Temp;
};
void initialize(ifstream& indata, MonthlyRec list[], int listSize);
void getData (ifstream& infile, MonthlyRec list {}, int listSize);
void totalRainforYear(MonthlyRec
void highTempforYear(ofstream& outData, MonthlyRec list[], int listSize);
void lowTempforYear(ofstream& outData, MonthlyRec list[], intlistSize);
2)#include <iomanip>
#include <cstring>
using namespace std;
struct MonthlyInfo
{
int Month;
double Temp;
double RainFall;
};
int main()
{
MonthlyRec Month[12]; // Array of 12 structures
int index; // Loop Counter
// Get monthly data
cout << "Enter the month, how much it rained and the average\n";
cout << "temperature for the month. \n";
for (index = 0; index < 12; index++);
I am still working on it, I was just wondering if anybody had any ideas.