[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.)
Recommended Answers
Jump to Postwhat will i write on the **?????
Nothing. The above example is working code, try it out. If you're wondering what the '**' are for, click here to learn about pointers.
Also please read this and this about using code-tags. It makes …
Jump to Postwhen i input rows and column....
the print result are all X...
I gave it a try and there is one 'X' rest being '*'.
// output was after userinput Airplane Seat Assignment ****** *[B]X[/B]**** ****** ****** ****** ****** ****** ****** ****** ****** ****** ****** ******
I.e. …
Jump to Postcan u at least put some spaces in between your sentences..
Jump to Post/*first error checking!*/
if (row>ROWS || row < 0 || seat>SEATS || seat <0)
return 1; //error!what are this for????
Well, it is a check for valid ranges with regard to the array. You must not access any array out of bounds. Actually there is a slight error, it …
Jump to PostHOLY SMOKES
I'm glad i got out of this thread when I did.
(i saw it coming)
All 54 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.