Project 3: Exam Scoring
System
Introduction:
This program is supposed to generate a numerical score and a letter grade for students based on their answers for an exam. All questions on the exam are multiple choice and the answer is one from the set {A, B, C, D}. Each question has just one correct answer. There are exactly 20 questions on the exam.
Program details:
Your program should be in a file called ExamScore.java. All the methods and variable
declarations should be in
this class. This class should also contain the main method. within the main
method open the input and output files and then invoke a method called generateScores()
that will process the input file and generate the output file containing
student scores. Also write more methods, as you deem appropriate.
The program should read the student answers from an input file called students.txt. The input file comprises of the following lines:
ABCABDCCAABDCDCABBDA
Note:
There are exactly 20 characters in the above string indicating answers to 20
questions.
123456789|ABC BDCCBABDC CABCDA
The output file should be named scores.txt and contain the following information:
93.00 - 100.00 A
90.00 - 92.99 A-
87.00 - 89.99 B+
83.00 - 86.99 B
80.00 - 82.99 B-
77.00 - 79.99 C+
73.00 - 76.99 C
70.00 - 72.99 C
67.00 - 69.99 D+
63.00 - 66.99 D
60.00 - 62.99 D-
0
- 59.99 F
An
example line is shown below:
123456789 94.00 A
An example
is shown below:
Average score: 75.50
Assume that examscore is
a variable of type double.
DecimalFormat df = new
DecimalFormat();
df.setMinimumFractionDigits(2);
df.setMaximumFractionDigits(2);
String str = df.format(examscore);
The String str will
then contain the formatted number for printing out.
Make sure you use
javadoc to comment your code.
You'll be expected to observe good programming
and documentation standards. You will be expected to follow these standards and
others in all of your later programs. Some, specifics include:
Testing
You should test your program within the BlueJ
environment to make sure that you implemented all the above requirements
correctly. Later, you will be provided with test files to test your program
with. You should be certain that your program produces the output given above
when you use the given input file and the sample test files provided on the
course web site. However, verifying that your program produces correct results
on a few test cases does not constitute a satisfactory testing regimen. You
should make up and try additional input files as well; of course, you'll have
to determine what the correct output would be. Your program for this project is
a stand-alone program. No other program will invoke its methods.
Submitting your
Program
More information on how to submit
your program will be provided in short time.
Pledge
Every program submission for this class must
include an Honor Code pledge. Specifically, you must always include the following pledge statement in the header comment for
your program:
/****************************************************************
*
* On my honor:
*
* - I have not discussed the Java
language code in my program
* with anyone other than my
instructor or the teaching assistants
* assigned to this course.
*
* - I have not used Java language
code obtained from another
* student, or any other
unauthorized source, either modified or
* unmodified.
*
* - If any Java language code or
documentation used in my program
* was obtained from another
source, such as a text book or course
* notes, that has been clearly
noted with a proper citation in
* the comments of my program.
*
* - I have not designed this
program in such a way as to defeat
* or interfere with the normal
operation of the Curator System.
*
* Your Name
* Your PID
***************************************************************/
Failure to include
this pledge in a submission is a violation of the Honor Code.