i don't understand what's wrong,
anyhelp would be great thank; OK then I have my code:
class MySums // to calculate the average of three numbers,
//one dealing with integers, the other with double
{
public static void main ( String [] args)
{
averageI(23, 45, 89);
}
public static int averageI (int num1, int num2, int num3)
{
int num4 = ((num1 + num2 + num3)/3);
return num4;
// calcualte the average of the three numbers
// return the average
}
public static void averageI (double Num1, double Num2, double Num3)
{
double Num4 = ((Num1 + Num2 + Num3)/3);
return Num4;
System.out.println("integer average is " + averageI(23, 45, 89));
}
}
its suppost to return the values Num4 and num4, but it says
'cannot return a value from method whose result type is void, return Num4'
^(this is supposed to go under the N of Num4)
I don't know what the problem means so I don't know how to correct it.
|