Programming Assignment 18

 

 

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! 

 

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.  (Use a function)

            b.     Read the student's answers into an array called ans.  (Use the 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 Hartwick ACDBCDEECABEBCDACDEDCACDE

Blaise Pascal BCDBADEECCDEBCDADBEDCECDE

Ada Lovelace  ACDBBDEDCADEBCDBCBEDCAADE

 

 

OUTPUT

 

Mary Hartwick     88.0%

Blaise Pascal         80.0%

Ada Lovelace        88.0%

 

Class Average        85.3%

Highest Score         88.0%