Hey guyz im beginner from java programming. Could anyone please help me fix my problem?
I have this method
public void determineClassAverage()
{
Scanner input = new Scanner(System.in);
int total; // sum of grade
int gradeCounter; //number of grade to be entered NEXT
int grade; // grade value
int average; // avarage of grades
//initialization phase
total = 0; //initial total
gradeCounter = 1; // loop counter
//processing phase
while (gradeCounter <= 10)//loop 10 times
{
System.out.print("Enter: ");
grade = input.nextInt();
total = total + grade;
gradeCounter = gradeCounter + 1; //increment counter by 1
} //end of while
average = total/10;
System.out.printf("\nTotal of all 0 grades is %d\n", total);
System.out.printf("\nClass average is %d\n", average);
} //end of determineClassAverage
---------------------------------------------------------------------------
and I want to call in the other file
public class GradeBookTest {
// main method begins program excution
public static void main(String[] args)
{
// create GradeBook object
GradeBook myGradeBook = new GradeBook("CS1 Intro Java Prog");
myGradeBook.displayMessage();
myGradeBook.determineClassAverage();
}
}
it gives me an error
C:\Users\DonCripz\Documents\JCreator LE\MyProjects\GradeBook\GradeBookTest\src\GradeBookTest.java:11: cannot find symbol
symbol : method determineClassAverage()
location: class GradeBook
myGradeBook.determineClassAverage();
^
can you help me fix this problem? please!