THREAD: what is wrong with this java code?
  1. 12-21-2017, 12:38 AM
    32
    Posts
    30
    Reputation
    May 2017
    NextGenUpdate
    import java.util.Scanner;
    public class Program
    {
    public static void main(String[] args) {
    int age;
    Scanner input = new Scanner(System.in);
    age = input.nextInt();
    if(age>16){
    System.out.println("get a job");
    if(age>1Cool Man (aka Tustin){
    System.out.println("you are old enough to smoke weed now");
    }
    }
    }
    else
    {
    System.out.println("sorry mate u are to young 4 either one");
    }
    }
  2. 12-21-2017, 02:43 AM
    32
    Posts
    30
    Reputation
    May 2017
    NextGenUpdate
    i figured it out...heres the correct code

    import java.util.Scanner;
    public class Program
    {
    public static void main(String[] args) {
    int age;
    Scanner input = new Scanner(System.in);
    age = input.nextInt();
    if(age>16){
    System.out.println("get a job");
    if(age>1Cool Man (aka Tustin){
    System.out.println("you are old enough to smoke weed now");
    }
    }

    else
    {
    System.out.println("sorry mate u are to young 4 either one");
    }
    }
    }