Friends,
I'm taking a Java programming class online and it seems that the lecture nor the book explains in detail the finer points needed for my programs to work. Thus far, I've gotten by with what I know of prior languages and trial and error. However, I'm having problems with this driver class program and I need it finished by Friday and I can't get it to compile so I can see if the results it is giving me is correct.
The problem centers around the "if statement" if (cat (this.age >= 3) && (this.declawed == false)and the print.out "get" lines. The errors are nonstatic variable and can't find symbol. Can anyone point me in the right direction. (I have the cat.java program and it compiled nicely.) Thanks!!
import java.util.*;
public class OwensDianaWeek6Prog
{
public static void main (String[] args)
{
cat myCat1 = new cat(); //intializes cat 1
cat myCat2 = new cat(); //intializes cat 2
cat myCat3 = new cat(); //intializes cat 3
Scanner input = new Scanner(System.in);
for (int i=0; i<3; i++)
{
System.out.println("Enter the name of cat" + (i+1) + ":");
String name = input.next();
System.out.println("Enter the age of cat" + (i+1) + ":");
int age = input.nextInt();
System.out.println("Enter the weight of cat" + (i+1) + ":");
double weight = input.nextDouble();
System.out.println("Enter the breed of cat" + (i+1) + ":");
String breed = input.next();
System.out.println("Is cat" + (i+1) + "declawed? True or False:");
boolean declawed = input.nextBoolean();
myCat1.set(name, age, weight);
myCat1.setBreed(breed);
myCat2.set(name, age, weight);
myCat2.setBreed(breed);
myCat3.set(name, age, weight);
myCat3.setBreed(breed);
} //end for
if (cat (this.age >= 3) && (this.declawed == false))
{
System.out.println("The cats over 3 with claws are:");
System.out.println("Name: " + getName(name));
System.out.println("Age: " + getAge(age) + "Years Old");
} //end if
}// main
} // end class OwensDianaWeek6Prog