Instructions Write a program in C++ 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 average high temperature for the year. 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. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. These functions must all have the appropriate parameters. An example of the program is shown below: Enter high temperature for each month 60 68 72 72 73 76 80 81 75 72 67 66 Enter low temperature for each month 40 52 55 57 56 60 61 63 69 68 51 62 Average high temperature: 71 Average low temperature: 57 Highest temperature: 81 Lowest temperature: 40

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.4: Arrays As Arguments
Problem 6E: (Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current,...
icon
Related questions
Question
100%

Instructions

Write a program in C++ 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 average high temperature for the year.
  • 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.
  • Function indexLowTemp: This function returns the index of the lowest low temperature in the array.

    These functions must all have the appropriate parameters.

An example of the program is shown below:

Enter high temperature for each month 60 68 72 72 73 76 80 81 75 72 67 66 Enter low temperature for each month 40 52 55 57 56 60 61 63 69 68 51 62 Average high temperature: 71 Average low temperature: 57 Highest temperature: 81 Lowest temperature: 40

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
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++ 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
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,