Originally Posted by
Java_noob333
its not throwing any errors any more. I just cannot figure out why it wont run the commands three times for each of the three variables (cat1,cat2,cat3)
It's exactly as I explained before: you only ask the user for each specific bit of input once. Programs are dumb, they can't read minds, and they'll only do what you tell them to. For instance if I want the user to multiply two numbers, this code won't work:
Scanner scan = new Scanner();
System.out.println("Enter a number: ");
int x = scan.nextInt();
int y = x;
System.out.println("The answer is: " + (x * y));
Even though I have two int variables above, I only ask for a numeric value once, and so I use the same numeric value for both numbers (kind of what you're doing with your current code.
To get two distinct numbers above, I have to ask the same question and retrieve the same data two times (more if I want to get more numbers). i.e.,
Scanner scan = new Scanner();
System.out.println("Enter a number: ");
int x = scan.nextInt();
// here I ask a *second* time
System.out.println("Enter a number: ");
int y = scan.nextInt();
System.out.println("The answer is: " + (x * y));
You have to do the same thing -- you have to write code that asks for your Cat data 3 times. Again the easiest way to do this is to create an array of Cat[] cats = new Cat[3], and then use a for loop that loops 3 times, getting data from the user each time, creating a new Cat in the loop, and filling in the respective Cat array item with this new Cat that has new data.