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.) е.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education