I am new to java programming. I am having a problem on how to use the method for char
here. What do you return in the char
method to get the average of the ASCII values in the main body? Thanks!
public static int average(int i,int j)
{
return (i + j) / 2;
}
public static double average(double a,double b)
{
return (a + b) / 2;
}
public static char average(char first,char second)
{
return ?;
}
public static void main(String[] args)
{
char first = 'a', second = 'b';
int i = 5, j = 12;
double a = 5.5, b = 8.5;
System.out.println("Average of (x,y) is : " + average(first,second));
System.out.println("Average of (a,b) is : " + average(a,b));
System.out.println("Average of (i,j) is : " + average(i,j));
}