Grade Analyzer difficulty with main method


#1

Im getting errors on my main method on this code, anyone seeing what Im doing wrong?

import java.util.Arraylist;
public class GradeAnalyzer{

public GradeAnalyzer(){

}
public int getAvereage(ArrayListgrades){
if (grades.size<1){
System.out.println("your grades list is empty");
return 0;
}
else{
int sum=0;
for(integer grade:grades){
sum+=grade;
}
int average=sum/grades.size();
system.out.println("the grades average is"+ "..." +average);
return average;

 }

public static void main(String[] args) {
ArrayList myClassroom = new ArrayList();
myClassroom.add(98);
myClassroom.add(92);
myClassroom.add(88);
myClassroom.add(75);
myClassroom.add(61);
myClassroom.add(89);
myClassroom.add(95);

GradeAnalyzer myAnalyzer = new GradeAnalyzer();
		myAnalyzer.getAverage(myClassroom);
}

}
}

https://www.codecademy.com/courses/learn-java/projects/grades-analyzer

here are the errors Im getting;

GradeAnalyzer.java:23: error: illegal start of expression
public static void main(String[] args) {
^
GradeAnalyzer.java:23: error: illegal start of expression
public static void main(String[] args) {
^
GradeAnalyzer.java:23: error: ';' expected
public static void main(String[] args) {
^
GradeAnalyzer.java:23: error: '.class' expected
public static void main(String[] args) {
^
GradeAnalyzer.java:23: error: ';' expected
public static void main(String[] args) {
^
5 errors


Replace this line with your code.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.