Do |
This project has one class, Rain. When you open the class in the
class editor, you will see that a 2-D array called rainData has
been defined and initialized. Each entry in the array contains a
double that represents the amount of rain in inches that fell on
that day. Flex your 2-D array muscles by writing the following
methods:
- Write a method called totalRainfall that returns the total
amount of rainfall (in inches) for the entire time period.
- Write a method called dryDays that returns the number of dry
days (days with no rain).
- Write a method called averageRainfall that returns the average
rainfall over all days.
- Write a method called weekendRain that returns the number of
weekend days which had some rain.
- Write a method called washouts that returns the number of
"washout weekends" - this is the number of weekends in which it
rained on both Saturday and Sunday.
- Write a method called dryWeeks that returns the number of dry
weeks - this is the number of weeks in which there was no rain all
week.
|