index no.student room
2 3 D/BARU
2 9 D/BARU
2 1 D/BARU
4 44 A005
4 1 A002
4 1 A002
4 19 A002
4 19 A002
4 35 A001
4 29 BSK 2/3
4 25 A106/107
4 10 A005
4 0 B202
4 10 B208/209
4 20 D/BARU
4 54 A 101
4 0 A 101
4 50 A 118
4 30 A 102
4 19 A 202
i got a problem to compare the data of index and room before adding value of no.student
this is part of my code:
int countFor = 0;
int bilStudent[] = new int[10000];
int index[] = new int[10000];
int student[] = new int[10000];
String room[] = new String[10000];
int count = 0; // this count is number of row or total data. currently count = 2637
for(int m=0; m<count; m++)
{
if(index[m] == index[m+1])
{
if(room[m].equalsIgnoreCase(room[m+1]))
{
countFor++;
}
else
{
for(int n=0; n<=countFor; n++)
{
if(countFor == 0)
{
bil
}
else
{
bilStudent[n]
}
}
}
}
}
the problem is to compare index[m] with index[m+1].
if data for index[m] and index[m+1] is same then
it will check room whether same or not for room[m] and room[m+1]
if same then it will add the data from same room and same index
eg : 13 for first 3 index for D/BARU
and if room is not equal even index is same then it will calculate only for same room on same index..
im stuck here and still confused on how to add no.student and add it to array billStudent[].