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