I want to add up the values of temperature, humidity, and sunshine, but I don't know why it says that the "sunshine" variable isn't declared. I want it to work so that when the user types in "yes", then sunshine gets set to 25, and if they type no, it gets set to -25. Thanks!
int temperature;
double humidity;
int sunshine;
String temp;
double rating;
temp = JOptionPane.showInputDialog(null, "What temperature is it outside?");
temperature = Integer.parseInt(temp);
temp = JOptionPane.showInputDialog(null, "What percentage of humidity is there?");
humidity = Double.parseDouble(temp);
temp = JOptionPane.showInputDialog(null, "Is it cloudy out?");
if (temp.equals("yes"))
sunshine = 25;
if (temp.equals("no"))
sunshine = -25;
rating = temperature + humidity + sunshine;