Explore BrainMass

Coding in Java

The history teacher at your school needs help grading a True/False test. The students' IDs and test answers are stored in a file.
The first entry in the file contains the answers to the test form:


Every other entry in the file is the student's ID, followed by a blank, followed by the student's response. Fore example, the entry:


indicates that the student's ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and so on. This student did not answer question 9. The exam has 20 questions, and the class has more than 150 students. Each correct answer is awarded two points, each wrong answer gets -1 point, and no answer gets 0 points.

Write a program that processes the test data. The output should be the Student's ID, followed by the answers, followed by the test score, followed by the test grade. Assume the following grade scale: 90% - 100% A; 80%-89.99% B; 70%-79.99% C; 60%-69.99% D; and 0%-59.99% F.

Solution Summary

The solution codes in java to sort student I.D's