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????

  1. [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....

void getData();
void averageHigh();
int main()
return 0;

void getData()
int total;
int x,y,ht,lt;
const a=12,b=2;
int array[a][b];
    cout<<"Month :"<<x<<endl;
      cout<<"Enter Highest Temperature: ";
        cout<<"Enter Lowest Temperature: ";


sori for bad writting style.....

Edited by Dani: Formatting fixed

8 Years
Discussion Span
Last Post by YoDjinthehouse

There are many Mistakes in your Program.

Some of them i have found. But i will not post the total code for you i will only point the mistakes and you should solve them on your own.

So here Goes:

1)In your Program You are using functions like "cout<<" and "endl" but have not used the Namespace that holds all these functions .

I mean you need to add

using namespace std;

Into Your Code.

And After that.

Positioning of the Code Blocks. Just go to the code and try to analyse what you have programmed it to do.

Some things like Whether you have given the variables values before printing them out Should Be Checked.

Also The Usage of "{" and "}" Please check them too.


can you give me the overall format for the program???

just a summary..

i dont really know how to use array function...

i am using Borland C++


I prefer That you try to understand how the functions blocks are working and try to sort them out appropriately. And Try To Make Improvements.


Best of luck

Votes + Comments
It was really necessary to hijack a 4 year old thread only to wish good luck to the person who posted, knowing that the thread is 4 years old.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.