Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Opgaver {
  4. public static void main(String[] args) {
  5.  
  6. int age;
  7.  
  8. Scanner input = new Scanner(System.in);
  9.  
  10. System.out.print("Hey dude, how old are you? ");
  11. age = input.nextInt();
  12.  
  13. if (age < 16)
  14. System.out.println("You can't drive!");
  15.  
  16. else if (age > 15 && age < 18)
  17. System.out.println("You can drive, but not vote.");
  18.  
  19. else if (age > 17 && age < 25)
  20. System.out.println("You can vote but not rent a car.");
  21.  
  22. else if (age >= 25)
  23. System.out.println("You can do pretty much anything!");
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement