Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 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.  
  17. else if (age > 15 && age < 18)
  18. {
  19. System.out.println("You can drive, but not vote.");
  20. }
  21. else if (age > 17 && age < 25)
  22. {
  23. System.out.println("You can vote but not rent a car.");
  24. }
  25. else if (age >= 25)
  26. {
  27. System.out.println("You can do pretty much anything!");
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement