Any Java programmers here?

Any Java programmers here?

public class Flan {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("How old is your cat?: ");
int age = input.nextInt();
System.out.print("How many years have you had your cat? ");
int time = input.nextInt();
int diff = age - time;


int age2 = ((age - 2) * 4) + 24;
int diff2 = ((diff - 2) * 4) + 24;


if (age == 1) {
System.out.println("Your cat is approximately 15 years old.");
if (age == 1 && age > time) {
System.out.println("You've had it since it was a baby!");
}
if (age == 1 && age < time){
System.out.println("How the hell did you have your cat longer than it has existed for?");
}
}
if (age == 2) {
System.out.println("Your cat is approximately 24 years old");
if (age == 2 && age > time && time == 2){
System.out.println("You've had it since he was a baby!");
}
if (age == 2 && age > time && time == 1){
System.out.println("You've had your cat since it was a 15 year old!");
}
if (age == 2 && age < time){
System.out.println("How the hell did you have your cat longer than it existed for?");
}
}
if (age > 2) {
System.out.println("Your cat is approximately " + age2 + " Years old");
if (age > 2 && age == time){
System.out.println("You've had it since he was a baby!");
}
if (age > 2 && age > time){
System.out.println("You've had it since it was a " + diff2 + " year old");
}
if (age > 2 && age < time){
System.out.println("How the hell did you have your cat longer than it existed for?");
}

}

}

goodevening sir how can i help this evening sir

Java is a poo language.

what is this 30 seconds into your first day of cs1?? what u need help wit nigga

Rofl. Only using if loops. Go read your lecture slidea and fuck off OP.

might as well ask
>anyone here named Pajeet from Verizon

> if loops
Huehuehue

Also OP holy fuck this better be your first time ever writing code

yes this is java programmer how am I assist you today?

Prateek from AT&T here.
life is suffering.

>if
>if
>if
>if
Good to know I have to worry about you competing in the job market.

This is rajeesh from comcast

not a good look. Plus this {
} is a pet peeve of mine. I was taught that good form meant brackets begin:

{
{
{
// You're a fag
}
}
} and end in line with each other so you can tell what the fuck you're looking at

> Not knowing Sup Forums fucks up the format
Upvoted

At my shop we hired a pooinloo to do all of our QA like 6 months ago, manager-level position, at least 6 figure salary. since then he's literally put in two code commits and spent the rest of his time playing pool and bugging everyone around him for help with the most basic shit (like how to fucking SSH). I'm convinced you have to be literally retarded to not find a decent programming job

So this... is the power of Java... Woah...

You forgot to call him sir, you're fired

> Not even a fucking else
It hurts.

obama?

Real talk does it really matter if you use if, if/else or swtich case when even the shittiest computers you can buy come with at least an i5 and 8gb of RAM?
So what if your program has to go through a couple more instructions? It's not like you have your processor constantly at 100%

Missing a closing bracket for class, and import for Scanner.

Yes. Time complexity.

>conditional statements have bearing on time complexity

this line of thinking is how bloatware and exploits form

Why do you even need (age == 1) and (age == 2)? Is that some sort of requirement?

import java.util.Scanner;

public class Flan {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

System.out.print("How old is your cat?: ");
int age = input.nextInt();

System.out.print("How many years have you had your cat? ");
int time = input.nextInt();

int diff = age - time;
int age2 = ((age - 2) * 4) + 24;
int diff2 = ((diff - 2) * 4) + 24;

System.out.println("Your cat is approximately " + age2 + " Years old");

if (age == time)
System.out.println("You've had it since he was a baby!");
else if (age > time)
System.out.println("You've had it since it was a " + diff2 + " year old");
else
System.out.println("How the hell did you have your cat longer than it existed for?");
}
}

I'm far from an expert, but this should work fine.

this is Sup Forums, if you're not writing haskell you're not welcome.

...

> Title is in english
> Video is in Hindi
What?