Advertisement
Guest User

Untitled

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