3

need help on java output

view full story
linux-howto

http://www.daniweb.com – //less than 10= "too cold", 10-20= "avarage", 21-30="hot",bigger than 30 ="Too Hot" import javax.swing.JOptionPane; public class TmaTwo { public static void main(String[] args) { int number; int temp; String numString; numString = JOptionPane.showInputDialog ("Enter temperature:"); number = Integer.parseInt(numString); if (number < 10 ) JOptionPane.showMessageDialog(null, "Too cold", "Output", JOptionPane.INFORMATION_MESSAGE); else if (number <21 ) JOptionPane.showMessageDialog(null, "Average", "Output", JOptionPane.INFORMATION_MESSAGE); else if (number > 20 ) JOptionPane.showMessageDialog(null, "Hot", "Output", JOptionPane.INFORMATION_MESSAGE); else if (number > 29 ) JOptionPane.showMessageDialog(null, "Too Hot", "Output", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } } im just a new student and tried to solve this problem, my problem here is the output for "too hot" when i key in 31 or bigger than 30 only hot appeared. so i need help (General)