Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		System.out.println("What is you name? ");
		String line = input.nextLine();
		System.out.println("Your name is " + line);
		System.out.println("What is your age? ");
		int value = input.nextInt();
		while(value <= 0 || value > 120) {
		  System.out.println("What is your age? ");
		  value = input.nextInt();
		}
		if(value < 16) {
		  System.out.println("U can't drive");
		} else {
		  System.out.println("U can drive");
	  }
  }
}