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: Function getData: This function reads and stores data in the two- dimensional array. а. Function averageHigh: This function calculates and returns the aver- age high temperature for the year. b. Function averageLow: This function calculates and returns the average low temperature for the year. с. Function indexHighTemp: This function returns the index of the highest high temperature in the array. d. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. (These functions must all have the appropriate parameters.) е.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question

Can this code be inplemented on a input output file. The weather would be on the input file instead of typing it on the compiler. The sample output will be on an output file as demonstrated. In C++.

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:
Function getData: This function reads and stores data in the two-
dimensional array.
a.
Function averageHigh: This function calculates and returns the aver-
age high temperature for the year.
Function averageLow: This function calculates and returns the average
low temperature for the year.
b.
C.
Function indexHighTemp: This function returns the index of the
highest high temperature in the array.
d.
Function indexLowTemp: This function returns the index of the lowest
low temperature in the array.
(These functions must all have the appropriate parameters.)
е.
Transcribed Image Text: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: Function getData: This function reads and stores data in the two- dimensional array. a. Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Function averageLow: This function calculates and returns the average low temperature for the year. b. C. Function indexHighTemp: This function returns the index of the highest high temperature in the array. d. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. (These functions must all have the appropriate parameters.) е.
Sample Output of the Program:
The following is the Brownsville's yearlong high and low temperatures
Month
High
Low
January
February
70
53
74
56
March
78
60
April
May
84
68
88
73
June
91
76
July
August
September
93
76
93
77
90
74
October
85
67
November
78
60
December
71
53
Average high temperature: 82
Average low temperature: 66
Highest temperature: 93
Lowest temperature: 53
Transcribed Image Text:Sample Output of the Program: The following is the Brownsville's yearlong high and low temperatures Month High Low January February 70 53 74 56 March 78 60 April May 84 68 88 73 June 91 76 July August September 93 76 93 77 90 74 October 85 67 November 78 60 December 71 53 Average high temperature: 82 Average low temperature: 66 Highest temperature: 93 Lowest temperature: 53
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning