@DavidMcConnachi/

Java stuff

Java

Tests for Java CSE110

fork
loading
Files
  • Main.java
  • Algebra Tutor
  • Hollow Box
  • Pepper
  • Volley Ball
  • Arraything
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.Scanner;
 
public class Main { 
	public static void main(String[] args) {
		Scanner user_input = new Scanner(System.in);
        
		System.out.print("How old are you? ");
		int age = user_input.nextInt();
		if (age > 19) {
			System.out.println("Great! Do you have a car? Can you drive me to the airport?");
            }
		else
			System.out.println("Do you have $5 for the train to the airport?");
    }
		
}