Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Opgaver {
- public static void main(String[] args) {
- int age;
- Scanner input = new Scanner(System.in);
- System.out.print("Hey dude, how old are you? ");
- age = input.nextInt();
- if (age < 16) {
- System.out.println("You can't drive!");
- }
- else if (age > 15 && age < 18)
- {
- System.out.println("You can drive, but not vote.");
- }
- else if (age > 17 && age < 25)
- {
- System.out.println("You can vote but not rent a car.");
- }
- else if (age >= 25)
- {
- System.out.println("You can do pretty much anything!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement