For an assignment, one of the tasks is to display someone with a grade less than 40. So far i've got this:
-----------------------------------------------------
Enumeration enumName = NameGrade.keys() ;
Enumeration enumGrade = NameGrade.elements();
txtOutput.setText("");
while ( enumGrade.hasMoreElements() ){
currently converting object to string, then to integer and checking if its less than 40
if ( Integer.parseInt((String)enumGrade.nextElement() ) < 40){
txtOutput.append("Name: " + enumName.nextElement() + " - " + enumGrade.nextElement() + "%\n" );
InputName.setText("");
InputGrade.setText("");
}else{
}
----------------------------------------------------
Just isnt working :/ I input 2 people, one with a grade under and one with over 40 then click the button. At first it was displaying one person but with a different grade ;o then I changed it and it errors out showing nothing at all... I can imagine the error is blindingly obvious if anyone good with Java could check it out
Hope theres enough information there..
Thanks so much, you would be saving my neck as Im really not getting any of this
-----------------------------------------------------
Enumeration enumName = NameGrade.keys() ;
Enumeration enumGrade = NameGrade.elements();
txtOutput.setText("");
while ( enumGrade.hasMoreElements() ){
currently converting object to string, then to integer and checking if its less than 40
if ( Integer.parseInt((String)enumGrade.nextElement() ) < 40){
txtOutput.append("Name: " + enumName.nextElement() + " - " + enumGrade.nextElement() + "%\n" );
InputName.setText("");
InputGrade.setText("");
}else{
}
----------------------------------------------------
Just isnt working :/ I input 2 people, one with a grade under and one with over 40 then click the button. At first it was displaying one person but with a different grade ;o then I changed it and it errors out showing nothing at all... I can imagine the error is blindingly obvious if anyone good with Java could check it out

Thanks so much, you would be saving my neck as Im really not getting any of this
