This a portion of my code with 2 sets of 2d array
public class Form2
{
public static void main(String[] args){
int[][] dayForm = { {25,15,28,17,19},
{31,21},
{23,24,19,18},
{15,19,22},
{14,17,13,18},
{8,12}};
int[][] boardForm = { {10,18,17,17,15},
{16,9},
{13,19,15,25},
{11,10,8},
{14,17,19,13},
{11,4}};
final int SIZE = 4;
int[] totalday = new int[SIZE];
showaverage(dayForm);
}}
public static void showaverage(int[][] arr)
{int total,average;
int form = 1;
System.out.println("Day Students :");
for(int row = 0;row <dayForm.length;row++)
{ total=0;
average=0;
for(int col = 0;col < dayForm[row].length;col++)
{total +=dayForm[row][col];}
average = total / dayForm[row].length;
System.out.println("Form "+form+" average students is "+average);
form++;
}
}
It seems that i encounter a problem in passing the 2d array to the method.There a so many errors of "class ,interface or enum expected",anyway to deal with it?