My code seems to be wrong, but I can't figure it out, for whatever reason. Can anyone shed light on why it says, "setFeet() in Distance cannot be applied to (int)"?
public class Distance
{
private int feet;
private int inches;
public Distance()
{
feet = 0;
inches = 0;
}
public Distance(int feet, int inches)
{
this.feet = feet;
this.inches = inches;
}
public Distance(Distance distance)
{
distance.setFeet();
distance.setInches();
}
public int getFeet()
{
return feet;
}
public int getInches()
{
return inches;
}
public void setFeet(int feet)
{
feet = feet;
}
public void setInches(int inches)
{
this.inches = inches;
}
private int toInches()
{
return (distance.feet*12) + (distance.inches);
}
public void add(Distance dist)
{
}
public void add(int feet, int inches)
{
add(new Distance(feet, inches));
}
public String toString()
{
return (feet+"'"+inches+"\"");
}
}