So i am completely lost here are you using single instance of class object to hold the data of all the students?? 
if that is the case you need to use multi-dimensional array to hold the data of marks obtained.