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 userInputString; double userMonthlyRainfallFigure; for ( int index = 0; index < arrayGiven.length; index++ ) { userInputString = JOptionPane.showInputDialog ("Enter rainfall figure of month " + (index+1)); userMonthlyRainfallFigure = Double.parseDouble(userInputString); arrayGiven[ index ] = userMonthlyRainfallFigure; } } public static void main(String[] args) { final int MONTH_IN_A_YEAR =12; double [ ] rainfallStatus = new double [ MONTH_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