Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Problem The Weather Service Bureau department has data representing monthly rainfall for a year and we would like to create a table categorizing each

C++

Problem 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.

rainfall.txt

95 100 120 130 135 145 155 185 190 160 130 120 

Store the data file in the same folder of your lab6.cpp. 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 ------- --------------- -------------- 1 95 Dry 2 100 Dry 3 120 Average 4 130 Average 5 135 Average 6 145 Average 7 155 Average 8 185 Rainy 9 190 Rainy 10 160 Average 11 130 Average 12 120 Average Program Requirements: Implement the following functions in the program: void inputRainfall(int rainFal l[], int size) The function reads the monthly rainfall from the file rainFall.txt and stores them in the array rainFall int calculateAverageRainFall(int rainFall [], int size) Return the average monthly rainfall void classifyAndDisplayRainfall(int rainFall[], int months); Classify and display each month as average, rainy, or dry.

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago