Programming Assignment 16

 

 

Your history professor really liked the program you wrote to analyze the grades on the final.  Now she wants you to write a program to actually grade the final!  If this program is a success, you'll not only be exempt from taking the final -- you'll get an A in the class!

 

The final has 25 multiple choice questions.  Your program should accomplish the following tasks.

1.         Read the correct answers into an array called key.  (Use a function)

2.         For each student in the class (use an EOF loop).

            a.     Read the student's name.

            b.     Read the student's answers into an array called ans.  (Use the same function you used for 1.)

            c.     Compute the percentage correct.  (Use a function)

            d.     Print the student's name and percentage correct (with one decimal place and the % symbol).   (Do not use a function) 

3.         Print the class average and the highest score (as percentage correct with one decimal place and the % symbol)

 

 

Use the following input data to test your program. 

 

ACDBBDEECADEBCDACBEDCACDE

Mary       ACDBCDEECABEBCDACDEDCACDE

Blaise     BCDBADEECCDEBCDADBEDCECDE

Ada        ACDBBDEDCADEBCDBCBEDCAADE

 

 

OUTPUT

 

Mary                      88.0%

Blaise                     80.0%

Ada                        88.0%

 

Class Average        85.3%

Highest Score         88.0%