how can i make an array inside by a function?????
so that the value i will input will change....
I am using Borland C++.....
how can i start it????
- [SOLO] Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions:
a. FunctiongetData:Thisfunctionreadsandstoresdatainthetwodimensionalarray.
b. FunctionaverageHigh:Thisfunctioncalculatesandreturnstheaveragehightemperaturefortheyear.
c. FunctionaverageHigh:Thisfunctioncalculatesandreturnstheaveragelowtemperaturefortheyear.
d. FunctionindexHighTemp:Thisfunctionreturnstheindexofthehighesthightemperatureinthearray.
e. FunctionindexLowTemp:thisfunctionreturnstheindexofthelowestlowtemperatureinthearray.(These functions must all have the appropriate parameters.)
i have made this program and i think its useles....
i am just a newbie....
#include<iostream.h>
#include<conio.h>
void getData();
void averageHigh();
int main()
{
clrscr();
getData();
getch();
return 0;
}
void getData()
{
int total;
int x,y,ht,lt;
const a=12,b=2;
int array[a][b];
{
for(x=1;x<=12;x++)
{
cout<<"Month :"<<x<<endl;
for(y=0;y<1;y++)
{
cout<<"Enter Highest Temperature: ";
cin>>ht;
}
cout<<"Enter Lowest Temperature: ";
cin>>lt;
}
}
array[ht][lt];
total=array[ht][lt];
cout<<total;
}
sori for bad writting style.....