Hi!
Im just learning to code and Im following Buckys tutorial on YouTube
Im just up to part 18 so I really can't much, but I figured I'd try out something myself
So basically I wanted to make a code where you wrote in your age and it would give you three different answers based on what you putted in
Here's the code:
import java.util.Scanner;
class apples{
public static void main(String args[]){
Scanner ageInput = new Scanner(System.in);
int age;
System.out.println("Please enter your age here: ");
age = ageInput.nextInt();
if (ageInput.nextInt() >= 60)
System.out.println("You are a senior citizien");
else if (ageInput.nextInt() >=50)
System.out.println("You are in your 50s");
else
System.out.println("You are a young buck");
}
}
So the problem is that I have to insert three numbers before it will return any of the three answers that it should give
Help, please? And please keep in mind that I'm a newbie at this xP
So basically I wanted to make a code where you wrote in your age and it would give you three different answers based on what you putted in
Here's the code:
import java.util.Scanner;
class apples{
public static void main(String args[]){
Scanner ageInput = new Scanner(System.in);
int age;
System.out.println("Please enter your age here: ");
age = ageInput.nextInt();
if (ageInput.nextInt() >= 60)
System.out.println("You are a senior citizien");
else if (ageInput.nextInt() >=50)
System.out.println("You are in your 50s");
else
System.out.println("You are a young buck");
}
}
So the problem is that I have to insert three numbers before it will return any of the three answers that it should give