Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using OOP, write a C++ program that will indicate the number of days in a month the temperature was above average, below average, and at

Using OOP, write a C++ program that will indicate the number of days in a month the temperature was above average, below average, and at the average for the month of November. Using an array to count the number of days above average, below average, and average, read in an input file named NovTemps.txt that gives the temperature for each day for the month. The input file should be located in the current directory. If the temperature is above the average temperature, increment the count in the index of the array that holds the count for the days above average. If the temperature is below the average temperature, increment the count in the index of the array that holds the count for the days below average. If the temperature is equal to the average temperature, increment the count in the index of the array that holds the count for the days equal to the average temperature.

When the end of file has been reached, display the count for the number of days above average, the number of days below average, and the number of days equal to the average.

Be sure to place variables within the private accessor area of the class. Use a constructor to initialize the array elements to 0. No global variables. A submission of all code in main() will result in a grade of 0.

NovTemps.txt contains:

78

81

83

83

82

83

84

83

80

65

77

81

78

70

69

72

74

78

72

74

76

78

64

71

72

74

74

80

80

79

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago