java Program...

ok im working on an extra credit project and I just got it, im gonna post it here, and i'll tell ya guys how im doing... but if someone can direct me of what i need to start off.... thx.

Design a program which will grade one set of multiple choice tests. The output will consist of a table of student scores and a horizontal bar graph representing the frequency of letter grades. You must define a "Quiz" class and create a "Quiz" object as explained below. You do not need to write the main code. The main code passes the references of the input and output files to the Quiz class. The quiz class contains most of the processing including reading all the data into the varaiables and arrays. Your Quiz class should have public methods to: 1) sort the data in order by percent scroe; 2)sort the data in order by name: 3)write the quiz results table to the output files; and 4)write the graph to the output file. You should also have private methods to grade the quizzes, assign letter grades, and compute averages. Use as many other methods in the "Quiz" class as you deem necessary. The main code calls all the public object methods that it needs: one to write the quiz results table and the other to write the graph as well as the two sort methods. Send values to methods using parameters lists wherever appropriate. Don't worry about checking for input errors.

INPUT Data:

control record -->35 (3 students, 5 questions)

correct responses-->3 2 5 1 3 (this is the key)

student records -->JONES 3 2 2 1 2 (the student's name $ answers)

JACKSON3 2 5 13

CHANG 3 3 5 1 3

OUTPUT: Your output will look similar to the following two reports. Format your output where required.

(new page and down a few lines)

PROJECT 3QUIZ GRADING PROBLEM

NAMERAW SCOREPERCENT SCORE GRADE

JACKSON 5100A

CHANG4 80 B

JONES3 60 D

- -

CLASS AVG4.0080.00

PROJECT 3QUIZ GRADING PROBLEM BAR GRAPH

LETTER GRADE

A |**

B |*********

C |***************

D |******

F |***

FREQUENCY

YOUR Quiz class should use a one-dimensional array to hold the correct responses and another as a set of counters for the frequency of grades. You must also use an array of objects to hold the student records. The fields for each student record are: Name, array of responses, Raw Scroe, Percent Score, and Grade. You may use more arrays if desired.

All output will be done to a file. Use the infile.readLine() and outfile.println() methods for input and output to files.

You will need to use at least two classes for this project 1)Student: class that defines a student record.2)Quiz: the class that manipulates all the data once the quiz has been instantiated. You will NOT code the main program that intantiates the Quiz, calls the methods to produce the two reports.

and then he gave us the main code....

import java.io.*;//HERE IS THE MAIN CODE

publicclass GradeQuiz

{

publicstaticvoid main (String args[])throws IOException

{

if (args.length>=2)//files specified, processing continues

{

Buffered Reader infile =new BufferedReader(new FileReader(args[0]));

PrintWriter outfile =new PrintWriter(new FileWriter(args[1]));

Quiz thisquiz =new Quiz (infile, outfile);//create quiz

thisquiz.nameSort();//sort for output by names

thisquiz.printGrades();//print quiz results

thisquiz.scoreSort();//sort for output by scores

thisquiz.printGrades();//print quiz results

thisquiz.printGraph();//print Graph

infile.close();//close input file

outfile.close();//close output file

}

else

System.out.println("\tNot enough files specified on command line.");

}//end main method

}//end class GradeQuiz.

[4899 byte] By [Egydarceyes] at [2007-9-30 23:26:54]
# 1
Which class and school is this for.
chijava at 2007-7-7 14:02:44 > top of Java-index,Security,Event Handling...