I need to declare private vars-not static, and need to load arrays then output them to the console. I get some funky output:
The Baker College Grade Standard is:
Grade@19821f 90-100
Grade@addbf1 80-89
Grade@42e816 70-79
Grade@9304b1 60-69
Grade@190d11 50-59
Grade@a90653 0-49
My code is:
Anyone give me some guidance?
public class Grade {
private int gradeNumber;
private char[] letterGrade={'A','B','C','D','E','F'};
private String[] percent= "90-100","80-89","70-79","60-69","50-59","0-49"};
public void Grade(){
letterGrade[0] = ('A');
letterGrade[1] = ('B');
letterGrade[2] = ('C');
letterGrade[3] = ('D');
letterGrade[4] = ('E');
letterGrade[5] = ('F');
}
public static void main(String args[]) throws IOException {
Grade[] stgrde = new Grade[6];
stgrde[0]=new Grade();
stgrde[1]=new Grade();
stgrde[2]=new Grade();
stgrde[3]=new Grade();
stgrde[4]=new Grade();
stgrde[5]=new Grade();
System.out.println("The Baker College Grade Standard is: ");
for(int i=0;i<6; i++){
System.out.println(stgrde[i]+" "+ percent[i]);
}
}