Im trying to wirte 5 functions GETDATA: that reads in the two dimensional array;
average high that calulates and returns the average high temp; the average low temp that calulates and returns the average low temp; index high temp that returns the index or high temps; index low temp that returns the index of low temps;
This is what i got so far......
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cstdlib>
hiavg (ifstream& ch9, ofstream& ch9a, int& temparray [12][2], avg1)
{
Int sum, index, avg1;
Int hitemp index;
sum = 0
for (index = 0; index <12; index++)
sum = sum + hitemp [index]
avg1 = sum /12
return avg1;
}
loavg (ifstream& ch9, ofstream& ch9a, int& temparray [12][2], avg2);
{
Int sum, index, avg2;
Int lotemp [index];
sum = 0
for (index = 0; index < 12; index++)
sum = sum + lotemp [index]
avg2 = sum /12
return avg2;
}
hitemp(ifstream& ch9, ofstream& ch9a, int& temparray [12][2], ht);
{
Int temparray [maxIndex];
Int temparray [index];
Int index, maxIndex
Int ht;
Maxindex = 0
For (index = 1; index <12; index++)
If (temparray [maxIndex] < temparray [index])
maxIndex = index;
largesttemp = temparray[maxindex]
return ht;
}
lotemp(ifstream& ch9, ofstream& ch9a, int& temparray [12][2], lt);
{
Int temparray [maxIndex];
Int temparray [index];
Int index, maxIndex
Int lt;
Maxindex = 0
For (index = 1; index <12; index++)
If (temparray [maxIndex] > temparray [index])
maxIndex = index;
largesttemp = temparray[maxindex]
retun lt;
}
You are not specifying the return types on the function declarations.
The function implementations show void but return int ( Notice: int is lowercase as if and for)