Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculate and classify the rainfall average for 4 weeks. Firstly, read the rainfall rates for each day in the 4 weeks

Write a program that calculate and classify the rainfall average for 4 weeks.

Firstly, read the rainfall rates for each day in the 4 weeks and store them in a 2-dimentional array [4][7].

Write a method getClassification() to get the classification. The method should receive the rainfall average for a week from the main, and print the classification for that week: High, Medium or Low; based on the received average.

Rainfall average

average >= 6

6 > average > 3

average < = 3

Sample Run:

Please enter the rainfall rate for 4 weeks

week#1

6

8

3

4

5

6

7

week#2

2

1

2

3

2

3

5

week#3

3

5

5

7

3

2

6

week#4

4

3

5

6

7

3

2

Classification for each week:

week#1: High (7.57)

week#2: Low (2.57)

week#3: Medium (4.42)

week#4: Medium (4.20)

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions