RainfallTest.java - import javax.swing.JOptionPane public class RainfallTest public static void UserDetails(double arrayGiven String userInputString

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 UserDetails(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 '16

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture