The program is for 3 different amount of wages to be entered by the user and there should be 4 outcomes ,Sum(total), Average, Maximum and Minimum. Any help would be appreciated.



class Wages{
 
public static void main (String[]args){
 
double  array[] = new double[3], max, min ,sum ,x;{
		Screen.message("Please Enter Wages :    ");
		Screen.newline(2);
		for (int j = 0; j < array.length; j = j + 1){
		array[j] = Keyboard.readDouble();
}
		Screen.newline();			
		sum = 0;			
		x = Keyboard.readDouble();		
		sum = sum + x;
////////////////////////////////////////////////////////////////////////////////
 
// Maximum Element \\
 
max = array[0]; 
	 for (int j = 1; j < array.length; j = j + 1){
 
     if (array[j] > max  ) 
		max = array[j];	
 
	 else if (array[j] == max)
		Screen.newline();
 
	 else ; 
 
}
////////////////////////////////////////////////////////////////////////////////	
{
// Minimum Element \\	
 
min = array[0];
   	 for (int j = 1; j < array.length; j = j + 1){
 
     if (array[j] < min  ) 
		min = array[j];	
 
	 else if (array[j] == min)
		Screen.newline();
 
	 else ; // f[j] < min
 // skip
 
 
////////////////////////////////////////////////////////////////////////////////
 
		Screen.newline(2);
		Screen.message("Total Wages =       ");
		Screen.writeDouble(sum,2);
		Screen.newline(2);
 
		Screen.message("Average Wage =      ");
		Screen.writeDouble(sum/3,2);
		Screen.newline(2);	
 
		Screen.newline(2);	
		Screen.message("Maximum Wage =      ");
		Screen.writeDouble(max,2);
		Screen.newline();
 
		Screen.newline(2);	
		Screen.message("Minimum Wage =      ");
		Screen.writeDouble(min,2);
		Screen.newline(4);
}	
}
}
}
}