Monty374

Stages

Sep 28th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. package stages;
  2.  
  3. import javax.swing.JOptionPane;
  4.  
  5. /**
  6. *
  7. * @author stanzack027
  8. */
  9. public class Stages {
  10.  
  11. /**
  12. * @param args the command line arguments
  13. */
  14. public static void main(String[] args) {
  15. int agee;
  16. String age = JOptionPane.showInputDialog("How old are you?");
  17. agee = Integer.parseInt(age);
  18.  
  19. if (agee > 18) {
  20. System.out.println("adult");
  21. } else if (agee <= 5){
  22. System.out.println("toddler");
  23. } else if (agee <= 10) {
  24. System.out.println("child");
  25. } else if (agee <= 12) {
  26. System.out.println("preteen");
  27. } else {
  28. System.out.println("teen");
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment