I am wondering how could we create an array to store 100 student ids so i know we need to use loop for this but not sure how it will work. Can anyone help with that?


1 | int [] studentIDs = new int [ 100 ]; // Integer array named "studnetIDs" of size 100 |
1 2 3 | for ( int i = 0 ; i < studentIDs.length; i++) { // now the ith index in studentIDs can be referenced as studentIDs[i] } |
1 | int [][] studentDistribution = new int [ 4 ][ 25 ]; |
1 2 3 4 5 6 7 8 | for ( int j= 0 ; j< 4 ; j++) { showText( "Room " +(j+ 1 ), 100 +j* 125 , 20 ); for ( int i= 0 ; i< 25 ; i++) { showText( "" +studentDistribution[j][i], 100 +j* 125 , 60 +i* 20 ); } } |