Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ Problem 3 [20 points] The Weather Service Bureau department has data representing monthly rainfall for a year and we would like to create
In C++
Problem 3 [20 points] The Weather Service Bureau department has data representing monthly rainfall for a year and we would like to create a table categorizing each month as rainy (rainfall 20% higher than average) dry (rainfall 25% lower than average) or average. The data file for monthly rain fall is called rainfall.txt. Output The year's average monthly rainfall was 139 mm. September has the highest rainfall (190 mm). January has the lowes rainfall (95 mm) Month Rainfall(mm) Classification Dry 95 100 120 130 135 BBO00 vau AWNA 145 Dry Average Average Average Average Average Rainy Rainy Average Average 155 185 190 160 130 12 120 Average Program Requirements: Implement the following functions in the program: void inputRainfall(int rain Fal I[], int size) The function reads the monthly rainfall from the file rainfall.txt and stores them in the array rainFall int calculate AverageRain Fall(int rain Fall [], int size) Return the average monthly rainfall (rounded to the nearest millimeter). void classifyAndDisplay Rainfall(int rainFall[], int months); Display the average monthly rainfall, the month with the highest rainfall, and the month with the lowest rainfall. Also classify each month as average, rainy, or dry. Hint: Read data from a file. #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started