Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. You can assign the values during

Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. You can assign the values during declaration. The program should have methods that return the following:

The total rainfall for the year (sum the array)

The month having the most rain (search the array for the highest number and save the index and the value - The value is the amount of rainfall. Use an if statement to determine month. if the index is 0 it is January, if index is 1 it is February, etc...)

Your output should be as follows (with XX representing the numbers based on your array):

Total Rainfall for the Year: XX The month of MM has XX rainfall

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions