Answered step by step
Verified Expert Solution
Link Copied!

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++

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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. #include void inputRainFall(float rain Fall[], int size) //Open the file ifstream inputFile; inputFile.open("rainfall.txt"); //Initialize month counter int month = 0; //first month //Read the monthly rainfall in the file inputFile >> rainFall[month); GRADING Inside the program, put your name at the beginning of your program //YOUR NAME // CECS 282 LAB 11, 12, or 13 Return a printout of each problem in the lab assignment Demonstrate the lab assignments in the lab. Grade based on the successful execution of the program and the coding efficiency. Submit the lab assignment to the Beach Board

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

Data Science For Dummies

Authors: Lillian Pierson ,Jake Porway

2nd Edition

1119327636, 978-1119327639

More Books

Students also viewed these Databases questions