RainfallTest.java - package rainfall import javax.swing.JOptionPane public class RainfallTest public static void double arrayGiven String

RainfallTest.java - package rainfall import...

This preview shows page 1 out of 1 page.

package rainfall; import javax.swing.JOptionPane; public class RainfallTest { public static void fillArrayWithUserDetails( double[] arrayGiven ){ String userInputString; double userMonthlyRainfallFigure; for( int index = 0; index < arrayGiven.length; index++ ){ userInputString = JOptionPane.showInputDialog( " Please enter rainfall figures for month: " + ( index + 1 )); userMonthlyRainfallFigure = Double.parseDouble( userInputString ); arrayGiven[ index ] = userMonthlyRainfallFigure; } } public static void main( String [] args ){ final int MONTHS_IN_A_YEAR = 12; double [ ] rainfallStats = new double[ MONTHS_IN_A_YEAR ];
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '19

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes