So each line is a student number, then 2 test scores, then 7 homework scores? You need to expand your struct. You currently only have room for 1 test score and 1 homework. Make test two variables, test1 and test2, and make homework an array with 7 elements.
In your for loop, you're using cin >>, but trying to get data from the file. This will promt the user for input instead. You need to use inFile >>.