Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package stages;
- import javax.swing.JOptionPane;
- /**
- *
- * @author stanzack027
- */
- public class Stages {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- int agee;
- String age = JOptionPane.showInputDialog("How old are you?");
- agee = Integer.parseInt(age);
- if (agee > 18) {
- System.out.println("adult");
- } else if (agee <= 5){
- System.out.println("toddler");
- } else if (agee <= 10) {
- System.out.println("child");
- } else if (agee <= 12) {
- System.out.println("preteen");
- } else {
- System.out.println("teen");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment