public class GradeSystem {
public static void main (String args[]) {
........
public int searchStu(int id){ // problem happen
int i=0;
for (i=0; i<4; i++) {
if (student.getStudentID() == id) return i;}
return i;}
int id;
boolean d;
id = Integer.parseInt(JOptionPane.showInputDialog("Please input ID number : ",
JOptionPane.QUESTION_MESSAGE));
d = Student.isStudent(id);
if (id == 1132810){
int q=0;
do{
id = Integer.parseInt(JOptionPane.showInputDialog("Please input student number : ",JOptionPane.QUESTION_MESSAGE));
d = Student.isStudent(id);
if (d){ int index = searchStu(id);q=2;}
else {
JOptionPane.showMessageDialog(.......); q=1;}
}while(q==1);
teacher.teacherFunction();}
else if (d){
int index = searchStu(id);
Student.studentFunction();}
else
JOptionPane.showMessageDialog(........);
}
} //end main class