This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi all I am having a little problem. I have a class called Student in that class there is a variable: public final static char[] GRADES = {'A', 'B', 'C', 'D', 'F'}; I have another class called GradePoint Inside of that class I have a method: public boolean validateGrades(char tempGrade)throws Exception { boolean valid = false; for(int i = 0; i < GRADES.length; ++i) { if (tempGrade == GRADES.Student[i]) { valid = true; break; } } return valid; } The problem I am having is I need to accept user input and the validate the input...but I can't figure out how to get my method in the GradePoint class to use the array from the Student Class. PS this is the format the instructor wants us to use.
Originally posted by Valarie Brandt: I have a class called Student in that class there is a variable:
I have another class called GradePoint Inside of that class I have a method:
Code tags are good. Since GRADES is "public final static", it seems that you could use Student.GRADES[0], Student,GRADES[1], etc [ April 10, 2004: Message edited by: Marilyn de Queiroz ]
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt