chapter 6: classifying students, single-pass algorithm