I have the following data:
Maths abc10 4 def08 6 ;
English hrd45 3 ngh05 10 ; .
The word at the beginning is a keyword which is also in an enum, the following data are username and login pairs (there can be an unlimited number of these. The data for each keyword is terminated by ‘;’ and the data is terminated by ‘.’
I’m using the scanner class but I can’t get it to loop so that it can produce the following:
Maths abc10 4
Maths def08 6
English hrd45 3
English ngh05 10
Any Ideas? Thanks!
Store it all in a
Map<String, Map<String, Integer> >. Iterate over the lines, grabbing the subject and then the name. (Loop starts here). Check if the name is;and exit if it is. Grab the score, then add it to aMap<String, Integer>. Then grab the next name. (Loop ends here). Add the currentMap<String, Integer>to the bigMap<>, then do it all over again.