/*** To generate weather for location at longitude -98.76 and latitude 26.70 for* the month of February do:* java WeatherGenerator -98.76 26.70 3** Remember that January is 2, February is 3 and so on.*/public class WeatherGenerator {static final int WET = 1; // Use this value for a wet daystatic final int DRY = 2; // Use this value for a dry day// Number of days in each month, January is index 0,
...[Show More]
/*
*
* To generate weather for location at longitude -98.76 and latitude 26.70 for
* the month of February do:
* java WeatherGenerator -98.76 26.70 3
*
* Remember that January is 2, February is 3 and so on.
*/
public class WeatherGenerator {
static final int WET = 1; // Use this value for a wet day
static final int DRY = 2; // Use this value for a dry day
// Number of days in each month, January is index 0, February is index 1
static final int[] numberOfDaysInMonth = {31, 28, 31, 30, 31, 30, 31, 31,
30, 31, 30, 31};
/*
* Given a location (longitude, latitude) in the USA and a month of the
year, the method
* returns the forecast for the month based on the drywet and wetwet
transition
* probabilities
[Show Less]