Program 5, Gradebook

Short Description:

Write a program which given an input file containing scores for a class will compute the grades for each student in the class.

This assignment is worth 50 points.

Goals

When you finish this homework, you should:

Formal Description

I store my gradebook in a flat file. Each line corresponds to a single student in the class. Your job is to read in this file and compute the grades for all of the students.

The format for the space delimited file is:

An example input file (default.scores) might be:
Student Good 10 10 10 10 10 10 10 10 10 10 50 50 50 50 50 50 1 1 1 1 1 1 1 
Student Bad  10 5 0 0 0 0 0 0 0 0 35 20 0 0 0 0 .2 .1 .05 .1 1 1
Student Average 10 7 7 7 7 6 8 9 5  5 50 50 45 45 30 30 .9 .75 .6 .7 .9999 .9999
I compute the class score as a weighted average of the averages of these components. See this page for exact details.

Your program should prompt the user for a base file name. The input file name will be constructed by appending .scores to the base file name, and the output file name will be constructed by appending .grades to the base file name. So for example, if the base file name is Fall16CSCI130, the input file will be Fall16CSCI130.scores and the output file name will be Fall16CSCI130.grades. If the input file does not exist, your program should print an appropriate error message and exit.

For each line in the input file, your program should produce a space delimited line in the output file containing

Finally after all students have been processed, print a table indicating

This table should be well formatted and readable.

An example output file (default.grades) might be:

Good Student 100% 100% 100% 100% 100.0% A
Bad Student 15% 18% 12% 10% 14.8% F
Average Student 71% 83% 75% 70% 77.6% C

Total Students: 3
	A	1
	B	0
	C	1
	D	0
	F	1

I will test your program with the default files above. I will also test with Students.scores. The output should match Students.grades. I will use additional test files as well.

Required Files

A single source code file.

Submission

Email your final source code file to danbennett360@gmail.com.