Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compiling Error Method body missing

843785Dec 9 2008 — edited Dec 9 2008
Ok so i have a program that reads in 6 grades for 10 different students takes the avg and prints outs the Name 6 scores avg and the letter grade they would recieve in a nice chart using printf in my main method i get the error MIssing method body or declare abstract. Any help as to why i am getting this would be much appreciated.
import java.util.*;
import java.io.*;
public class Finals
{
    static Scanner input = new Scanner(System.in);
    public static void main(String[] args)throws IOException;
    {
        Scanner inFile = new Scanner(FileReader("Grades.txt"));
        double [] [] scores = new double [10] [6];
        String [] name = new String [10];
        double [] grade = new double [6];
        char [] lettergrade = new char [10];
        int row = 0;
        int collum = 0;
        int collum2 = 0;
        int index = 0;
        while(inFile.hasNext())
        {
            name[index] = input.Next();
            while(collum < 9)
            {
                scores[row][collum] = input.nextDouble();
                collum = collum + 1;
            }
            collum = 0;
            row = row + 1;
        }
        inFile.Close();
        calculation(score, name, grade);
        print(score, grade, name, lettergrade);
    }
    public static int calculation(double [] [] score, String [] name, double [] grade)
    {
        int index = 0;
        int row = 0;
        int collum = 0;
        int j = 0;
        int m = 0;
        int k = 0;
        //add all the grades in the first row store that into a new array called average than run through a loop to find out what letter grade it equals store letter grade in a char array
        while(collum < 10)
        {
            grade[j] = grade[j] + score[collum][row];
            row ++;
            if(row == 6)
            {
                collum ++;
                row = 0;
                j ++;
            }
        }
        return grade;
    }
    public static void print(double [] [] score, String [] name, double [] grade, char [] lettergrade)
    {
        int index = 0;
        int j = 0;
        while(index < 10)
        {
            if(score[j] >= 92.5)
            {
                lettergrade[j] = 'A';
                j ++;
                index ++;
            }
            else if(score[j] >= 82.5 && score[j] < 92.5)
            {
                lettergrade[j] = 'B';
                j ++;
                index ++;
            }
            else if(score[j] >= 72.5 && score[j] < 82.5)
            {
                lettergrade[j] = 'C';
                j ++;
                index ++;
            }
            else if(score[j] >= 62.5 && score[j] < 72.5)
            {
                lettergrade[j] = 'D';
                j ++;
                index ++;
            }
            else
            {
                lettergrade[j] = 'F';
                j ++;
                index ++;
            }
        }
        System.out.println("Student    Test1   Test2   Test3   Test4   Test5   Average   Grade");
        System.out.printf("11%s40%d8%d5%c", name, score, grade, lettergrade);
    }
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2009
Added on Dec 9 2008
1 comment
137 views