joel :
I know the problem exists on the forum, but I am really stuck. I would like to call my grade()
method into my display()
method to appear the grade. I don't know how to do...
Here is my grade()
method
public static void grade(int note){
String grade = "";
if (note <= 70){
grade = "Satisfaction";
}
else{
grade = "Great Satisfaction";
}
}
In my display()
method, I want to retrieve the grade for the student.
public static void display(String[] tabStudent, int[] tabNote, char code){
for(int i=0; i<tabStudent.length;i++){
if (code == 'e'){
if (tabNote[ i ] < 50){
System.out.println(tabStudent[i] + " " + tabNote[i] );
}
}
else if(code == 's'){
if (tabNote[ i ] > 50){
System.out.println(tabStudent[i] + " " + tabNote[i] + grade() );
}
}
}
}
My problem is this line below:
System.out.println(tabStudent[i] + " " + tabNote[i] + grade() );
Thank you for your help.
sleepToken :
Well, it needs to actually return something:
public static String grade(int note){
String grade = "";
if (note <= 70) {
grade = "Satisfaction";
} else {
grade = "Great Satisfaction";
}
return grade;
}