Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem statement: Average rainfall In the data files attached below, monthly rainfall data for Vancouver is given in mm from year 2017 to 2021. Each

image text in transcribed
Problem statement: Average rainfall In the data files attached below, monthly rainfall data for Vancouver is given in mm from year 2017 to 2021. Each file contains 12 lines. On each line there is a floating-point value. First line represents rainfall measured in Vancouver during January. Second line for February, and so on. Write a program that uses nested loops to read data from files and calculate some summarized values over a period of five years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will do necessary calculations. The outer loop should show the yearly average rainfall and maximum monthly rainfall value for each year. The program should display summarized data for five years as follows: Year Monthly average rainfall Ma 2017 97.7 19 2018 110.5 25 2019 77.8 16 2020 89.3 22 2021 94.7 31 Bonus question that is worth 20 points: On the output, show in which month maximum rainfall has happened. The output of your program with solution to bonus question should be as follows

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions