Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

* * * * * 1 votes

Writing a program to grade a multiple-choice exam -- College Freshman Level

python new hot grade program c++ java

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 JesmikaMikayla


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 30 November 2015 - 03:40 PM

You've been asked to write a program to grade a multiple choice exam. The exam has 20 questions, each answered with a little in the range of 'a' through 'f'. The data are stored on a file(data6.txt) where the first line is the key consisting of a string of 20 characters. The remaining lines on the files are exam answers, and consist of a student ID number, a space, and a string of 20 characters. The program should read the key, then read each exam and output the Student ID number, their answers, then the grade, then their standing (above or below average).
1234567 abcdefabcdefabcdefab
9876543 abddefbbbdefcbcdefac
5554446 abcdefabcdefabcdef
4445556 abcdefabcdefabcdefabcd
3332221 abcdefghijklmnopqrst
Enter the filename: data6.txt
Key: abcdefabcdefabcdefab
Student ID      Student Answers           Grade           standing
The average of the score is: ________
There are 7 records in the file (has to count this)
The student ID c1234567 has the highest score of 20 (have to print the variables)
I'm not sure how to read the key character by character then compare it to the inputted values, I am having trouble formatting, and differentiating between the ID and the answers.
Thanks so much!

Attached Thumbnails

  • 20151130_173345.jpg

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download