I have an assignment which must be like this way I want the user to enter how many modules he has in the college (so this will be in the first array), then I want to know from the user what are the marks he got in the assignment.
I wrote it but I have a problem with the code If anyone can help me, I will be grateful.
public class Main {
public static void main(String[] args) {
Scanner Sc = new Scanner(System.in);
int mo, i, j, a;
System.out.println(" Enter NO.modules you have");
mo = Sc.nextInt();
// create the Array
int[] tab = new int[mo];
for (a = 0; a < mo; a++) {
System.out.println(" Enter the module name : " + (a + 1));
tab[a] = Sc.nextInt();
}
int[][] list = new int[2][mo];
for (i = 0; i < 2; i++) {
for (j = 0; j < mo; j++) {
System.out.println(" Enter the marks of the Assignment : "+(i+1)+","+j);
list[i][j] = Sc.nextInt();
}
}
}
}