Project 1, Computing Grades.

Short Description:

Compute a student's grade in a class.

This assignment is worth 30 points.

Goals

When you finish this homework, you should have:

Formal Description

Create a flexible program that will compute the grades for a student based on a configuration file and a series of data files.

The configuration file contains lines of data describing a component of the class, the method used to compute the score for that component, the file containing the data for that component and the weight of that component in the total grade. An example file would be:

Homework points homework.dat  25%
Projects points projects.dat  45%
Tests  average test.dat 15%
Final  average final.dat  15%
Note that the different fields are separated by one or more spaces. Each line ends with a newline. The file does not contain carriage returns. The file is in proper format but may contain no data.

The fields are as follows

The program should begin by prompting the user for the name of the configuration file. Please use the prompt Enter the name of the configuration file: . If the name of a file that does not exist is supplied

To process a component.

To compute an average when the method to compute is average.

Files of this type contain zero or more integers with values between 0 and 100, followed by a percent sign and separated by one or more whitespace characters. An example file might be
75% 80% 
Compute the average by summing all of these numbers and dividing by the number of entries. In the above example, the average would be 77.50%.
0.75 + 0.8 = 1.55
1.55 / 2 = 0.775 = 77.50%

To compute an average when the method to compute is points.

Files of this type contain zero or more entries as follows. Each entry begins with an integer, followed by a / then another integer. Entries are separated by one or more whitespace characters. An example file might be
2/2  4/5
4/6
Compute the average by finding the percent for each entry, adding these percents then dividing by the number of entries. For the above file
   2/2 = 100%
   4/5 = 80%
   4/6 = 66.66%
         ------
         246.66/3 = 82.22% 

Computing the final average

For each valid component, multiply the computed average for that component by the weight of that component. Add all of these scores and divide by the total of the weights of the valid components.

For example if the configuration file contains:

Homework points homework.dat  25%
Projects points projects.dat  45%
Tests  average test.dat 15%
Final  average finals.dat  15%
And the averages are as follows
Homework: 82.22%
Projects: 67.50%
Tests: 77.50%
Final: Error: Could not open finals.dat.
Note, in the example, finals.dat does not exist, so 15% of the class score is not available. The student only has a score for 85% of the class. The final average would be computed as
0.25 * 0.8222 + 0.45 * 0.675 + 0.15 * 0.775 = 0.62555 or 62.56%
Since the final exam did not have data, the score will be out of 85%
 0.25 + 0.45 + 0.15  = 0.85 or  85%
The final score will be
0.6256/0.85 = 0.73594 = 73.59%
Your program should finish by reporting the current average, the available percent of the class and the final average. For the above examples the output should be
Average 62.56% out of 85.00%.
Class average 73.59%.

Test Data

Other Notes

Required Files

A single tar file containing the source code and makefile for this program.

Please use this Makefile.

You will have a homework exercise that involves tar before this project is due.

Submission

Submit your tar file to the D2L assignment folder Project1.