I am trying to write a method that accepts two integer parameters and returns their average as a float, but for some reason it is only returning a double. I am quite sure that there needs to be "f" after the resulting value, but it's not showing up. Can someone please help me fix this?
public static float average(int x, int y)
{
return (x + y)/2;
}
System.out.println("average(\"7, 5\") = " + Lab7.average(7, 5));
RESTULTS:
average("7, 5") = 6.0