Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 136,251 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,216 people online right now. Registration is fast and FREE... Join Now!




Grading program

 
Reply to this topicStart new topic

Grading program

genuinek
13 Oct, 2008 - 10:01 PM
Post #1

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 23

I am looking to create a GUI grading program. I need to be able to read data from a file and get the averages and letter grade for each student. So far I am stumped here is my code so far:

CODE
import javax.swing.*;
import java.awt.*;
import java.util.Scanner;
import java.io.*;


public class Grading extends JFrame
{
    private JList studentList;
    private JLabel Avg;
    private JLabel letter;
    
        
    class studentGrades
    {
        public double Midterm;
        public double Final;
        public double Assignment1, Assignment2, Assignment3, Assignment4;
      
        public void main() throws IOException
        {
            File grades = new File("Asg3Data.txt");
            Scanner inputFile = new Scanner(grades);  
        
            inputFile.nextLine();
            String Student1 = inputFile.nextLine();
            String[] S1 = Student1.split("\\,");
            String Student2 = inputFile.nextLine();
            String[] S2 = Student2.split("\\,");
            String Student3 = inputFile.nextLine();
            String[] S3 = Student3.split("\\,");        
            String Student4 = inputFile.nextLine();
            String[] S4 = Student4.split("\\,");        
            String Student5 = inputFile.nextLine();
            String[] S5 = Student5.split("\\,");
            String Student6 = inputFile.nextLine();
            String[] S6 = Student6.split("\\,");
            String Student7 = inputFile.nextLine();
            String[] S7 = Student7.split("\\,");    
            String Student8 = inputFile.nextLine();
            String[] S8 = Student8.split("\\,");                      
        }
        
        
                                                
    }

    public static void main(String [] args)
    {
                
                
                
    }

}


Here is the content of the file i am reading from just in case:

LastName,FirstName, Exam1, Asg1, Asg2, Exam2, Asg3, Asg4
Christopher, Thomas, 78, 79, 82, 88, 78, 91
Cole, John, 100, 100, 100, 100, 100, 100
Karr, Arlen, 91, 86, 94, 100, 98, 93
McClurg, Andrew, 91, 87, 99, 87,,93
Noble, Rich, 84, 79, 85, 88, 90, 91
Rao, Sista, 91, 86, 94, 100, 98, 93
Stotz, Ralph, 81,83,,93, 78
Yi, Yu, 99, 88, 101, 76, 90, 94

User is offlineProfile CardPM
+Quote Post

AmitTheInfinity
RE: Grading Program
13 Oct, 2008 - 10:51 PM
Post #2

C Surfing ∞
Group Icon

Joined: 25 Jan, 2007
Posts: 1,025



Thanked: 35 times
Dream Kudos: 125
My Contributions
Two main functions in one class? blink.gif
User is online!Profile CardPM
+Quote Post

genuinek
RE: Grading Program
13 Oct, 2008 - 10:55 PM
Post #3

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 23

Should I just leave the file input and split methods in the public static void main function.



This post has been edited by genuinek: 13 Oct, 2008 - 10:56 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 04:15AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month