// ages import javax.swing.JOptionPane; public class age { public static void main(String[] args) { // Prompt the user to enter a number: String numString = JOptionPane.showInputDialog(null, "Enter your age:", "Input Window Demo", JOptionPane.QUESTION_MESSAGE); // Convert the string into an int value int age = Integer.parseInt(numString); System.out.println(" Your age is " + age + "."); /* A person is a teenager if their age is 13 thu 19 */ if (age > 12) if (age <20) System.out.println("You are a teenager!\n"); else System.out.println("You are too old to be a teenager!\n"); else System.out.println("You are too young to be a teenager!\n"); System.exit(0); } }