Okay so basically here is the outline of the project:
________________________________________________________________________________
You have been asked to write a program to grade several multiple-choice exams. The exam has less than 80 questions, each answered with a letter in the range of ‘a’ through ‘f’. The data are stored on several files such as exam1.dat where the first line is the key, consisting of a string of n characters (0<n < 80). The remaining lines on the file are exam answers, and consist of a student ID number, a space, and a string of n characters.
The program should have a while loop in the main routine to ask users input a data file name through keyboard. In this way, the program has a capability of repeatedly asking for a new data file in each while loop until users input a key word “exit”. Once “exit” is encountered, the while loop terminates and your program ends. A typical input exam data file (exam1.dat) looks like:
Apply strlen( ) or the length( ) of string to the first line of the above data file for determining the number of questions in the problem. If a student gives more answers than necessary, the extra answers will be automatically truncated. On the other hand, if a student provides less number of answers, the remaining unanswered questions are considered as being answered wrongly.
After users input an exam data file, your program should ask users to input another grade-curving file name (e.g., gradeCurving.dat). This second file contains the information to convert a percentile score to a curved grade in levels of ‘A’ through ‘E’. For instance, a grade-curving file takes the following format: a curved alphabetic grade, a space, a percentile grade served as marker.
A 90
B 80
C 70
D 60
E 50
The above information means that ‘A’ = 90 through 100; ‘B’=80 through 89; ‘C’=70 through 79; ‘D’ = 60 through 69; “E”=50 through 59; For the remaining grades, you can assign an ‘F’.
Furthermore, in each while loop in the main routine, your program should ask users to input an output file name such as score1.dat. The output file will store the scores for each student in a format: student ID number, a space, a percentile score, and a curved grade in ‘A’ though ‘E’. The program should also compute and display the following statistics for the graded answers: Average score, Maximum score, and Minimum score.
A typical output on a data file looks like:
1234567 90% A
9876543 85% B
5554446 95% A
4445556 75% C
5551112 80% B
Statistics:
Average Score: 85%
Minimum Score: 95%
Maximum Score: 75%
To provide solutions to this project, you need to deliver the following components on the basis of principles in software engineering.
________________________________________________________________________________
Basically I kind of want a rough outline of what you guys would do to make this program. Kind out lay out the steps. I've been coding for hours based off the hints that our instructor taught us, but my code is kind of messy. So the steps you guys lay out for me can really help me clean up my code.
Just kind of like what functions you would use, for loops, while loops, inFile and outFile, you know just different things in order.
I've been coding for hours based off the hints that our instructor taught us, but my code is kind of messy. So the steps you guys lay out for me can really help me clean up my code.
Why not try "lay out" this yourself, instead of "you guys"?
It is quite important thing - to be able to arrange in your mind your program before you write it (or while you are writing it).
Try to sit with a cup of tea, paper and pencil and to split your future program into kind of blocks (which later can become separate functions) etc. For example, your program will be reading from the files several times. Is file reading a simple matter? Perhaps it should be put into dedicated block? And how about reading a line of the file? And comparing this line to correct answers? etc.
You need to practice such "decomposition" anyway, so perhaps it is just the time to start. Post your decomposition results here when you have any.