Thread: My java problem
View Single Post
Old Apr 15th, 2004, 11:34 AM   #3
sykkn
Hobbyist Programmer
 
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5 sykkn is on a distinguished road
Your problem is that you are not using the correct form of calculateDogYears(). You define the method as calculateDogYears(int,int) but only called it with one arg.

Error:
Chicken-of-the-PowerBook:~/devel/java jowings$ javac DogsHumanAge.java
DogsHumanAge.java:42: calculateDogyears(int,int) in DogsHumanAge cannot be applied to (int)
double Dogyears = calculateDogyears(Humanyears);
         ^
1 error

I would guess that you meant to do something like this:
private double calculateDogyears(int Humanyears)
{
   return 13 + (int)(16.0 / 3.0 * (Humanyears - 1));
}

//SIDEBAR: please use the CODE tags when posting code. It makes things so very much easier to read.
__________________
[ [ SykkN alloc ] initWithThePowerTo: destroyYouAll ];
/* Don't make me use it! */
sykkn is offline   Reply With Quote