So i was given an assignment with some unusual parameters. My teacher likes to add difficult objectives to make the code longer (really just to be evil) and this project is proving to be a bit of a problem. I have worked on several programs he has assigned but the one i can not wrap my finger around is the one based on creating answer key and test results for students. I will post it below:


Write a C++ program to grade multiple-choice, including True/False, questions for an exam given in a class. A class may have one or more sections. The answer keys are the same for all sections of a class for one exam, but the number of students is normally different for different sections. Your program will be used for different classes and/or different exams, and the number of questions will be different. But any exam can have at most 30 questions. The answer key and a student's answer to a question could be a digit, between 1 and 5 (inclusive), or a character among A, B, C, D, E, F and T, or lower case equivalent.

Input Data
1. The first value in the input file is the number of questions of the exam.

2. The second line is the answer keys without spaces between any two answers.

3. The next line is the number of sections, followed by data for all sections.

4. The data for a section begins with the number of students, followed by students' data.

5. The data for each student is on a separate line, beginning with the answers from the student followed by the student's last name.

6. As the key answers, there is no space between any two answers.

7. The student's last name comes after his/her last answer without any spaces between.

8. Any student's last name has at most 15 characters.

Sample input is given later.
You can assume the input data are correct and do not check for invalid values.

Output Data
1. For each student, last name, number of correct answers, and Pass or Fail. A student passes an exam if the number of correct answers is 60% or better of total number of questions, and fails otherwise.

For each section, the total number of students and the number of students who passed the exam.

For the entire class, the number of sections, the total number of students and the number of students who passed the exam.

See sample output later for the exact output format.

The following requirements must be followed:

You must NOT use structs or 2D array.

You must use the following functions in your program.
// The function reads in numQuestions answers into array answers.
// Parameters: (out, in)
void ReadAnswers(char answers[], int numQuestions);

// The function compares a student's answers against the answer
// keys and passes back the number of correct answers and
// whether the student passed the exam.
// Parameters: (in, in, in, out, out)
void ProcessAnswer(const char keys[], const char answers[], int numQuestion, int& correct, bool& pass);

You must use the same function ReadAnswers() to read the answer keys and the answers for each student.

You must use for loops to process all sections of the class, all students of a section, and all answers of a student. No while loops are allowed on this assignment.

Your main() function could be like the following:
Read number of questions
Read and store the answer keys
Read number of sections
For each section
Process all students' answers
Update class results
Display results for the section
Display results for the entire class

You can also use function toupper(x) to convert a character to upper case. You need to include header file <ctype.h> to use the function.

Sample Input

Sample Output
Name          Correct Answers        PASS/FAIL
---------------      ---------------               ---------
      Hockney           8                         PASS
      Hill                    3                         FAIL
      Longwood        6                         PASS
      Sharp               5                         FAIL

2 out of 4 students of section 1 passed the exam.

        Name          Correct Answers        PASS/FAIL
---------------          ---------------            ---------
        Hockney                   10                PASS
           Hill                          9                PASS
       Longwood                  7                PASS
          Sharp                      5                FAIL
          Quick                      6                PASS

4 out of 5 students of section 2 passed the exam.
There are 2 sections, and 6 out of 9 students passed the exam.


So that is the entire thing. I understand if you do not want to help me with all of it however any help will be appreciated. Thank you for anything you are willing to/can do.
Please feel free to send me questions or emails if you have any questions about it.
Again you all rock for the help, this community is a great one indeed