P
psmith
This is driving me mad. Can somebody please show me where I am going
wrong here.
I have two hashmaps, one called Students, which contains some results
The one I am having problems with is called results. I need to know
how to iterate through an array to set the grade up as a key in the
hashmap. This is the element of code I am struggling with:
public class TutorGroup
{
/* instance variables */
Map<String, Student> students;
Map<Character, Set <String>> results;
/**
* Constructor for objects of class TutorGroup
*/
public TutorGroup()
{
this.students = new HashMap<String, Student>();
this.results = new HashMap<Character, Set<String>>();
}
public void collateResults()
{
char grades[] = {'A', 'B', 'C', 'D', 'F', 'X'};
for (int i = 0; i < grades.length; i++)
}
results.add(grades, " ");
}
The value element of the results map will eventually hold the student
who has achieved the respective grade.
Any help received greatly appreciated.
Paul
wrong here.
I have two hashmaps, one called Students, which contains some results
The one I am having problems with is called results. I need to know
how to iterate through an array to set the grade up as a key in the
hashmap. This is the element of code I am struggling with:
public class TutorGroup
{
/* instance variables */
Map<String, Student> students;
Map<Character, Set <String>> results;
/**
* Constructor for objects of class TutorGroup
*/
public TutorGroup()
{
this.students = new HashMap<String, Student>();
this.results = new HashMap<Character, Set<String>>();
}
public void collateResults()
{
char grades[] = {'A', 'B', 'C', 'D', 'F', 'X'};
for (int i = 0; i < grades.length; i++)
}
results.add(grades, " ");
}
The value element of the results map will eventually hold the student
who has achieved the respective grade.
Any help received greatly appreciated.
Paul