RainfallTest.java - import javax.swing.JOptionPane public...

This preview shows page 1 out of 1 page.

import javax.swing.JOptionPane; public class RainfallTest { public static void fillArrayWithUserDetails(double [] arrayGiven) { String input; double userMonthlyRainfallFigure; for(int index = 0; index < arrayGiven.length; index++) { input = JOptionPane.showInputDialog("Please enter rainfall for the month " + (index + 1)); userMonthlyRainfallFigure = Double.parseDouble( input ); 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
  • Cybernetics, Rain, public class, public static void fillArrayWithUserDetails

  • 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