[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 PostThe first thing you should do is break the problem down into simple steps, then outline the steps. From there you can translate those steps into C++ code, or a flowchart, or pseudo code, depending on how you learned about the process of programming.
Jump to Post> my teacher doesnt teach me that....
Then you don't need to use it. :D Ed was giving alternatives, not requirements.
Jump to Postthis is not a verbatim example that you should blindly copy.
this is an "OUTLINE", of general functionality, that give you a top-level overview of how the program goal can be accomplished.
you have already written the "user_input" function, for the most part. break out the part that …
Jump to Postdo i need to put #include<conio.h>
and
getch(); \\at the end..
No. The
cin.get();
will keep the console open.
If you are going to usecin >>
in your program, you'll need to addcin.ignore()
just above thecin.get()
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.