I've finished the program. Anyone who wants it, please read the info below, then PM me with the request.
First thing, this program is incomplete. The logic functions are all there, but there are no input/output functions (I figure those would be need to be re-written from scratch in order to be done in php). There is also no main function. There is a struct called wsgame, which represents columns C-J for any given row in the spreadsheet. The important logical function is called "getGrade," which takes two inputs; a wsgame, and a boolean 'generous.' The output is the letter grade. If 'generous' is false, then optional unknowns will get filled in with the most common values. If 'generous' is true, the optional unknowns get filled in with the best possible values. The program also uses a
TON of constants, in order to make it maintainable (should the requirements for getting a C grade change, one only has to redefine C_GRADE).
Anyway, in order to complete this, you would have to write the input and output functions yourself. The input function would take the user input to determine all of wsgame's values plus the generous value, and the output function would take the string produced by getGrade and display it on the screen. The basic program layout would look like this:
Code:
init(/*OUTPUT*/ &wsgame)
input(/*OUTPUT*/ &wsgame, &generous);
getGrade(/*INPUT*/ wsgame, generous, /*OUTPUT*/ &grade);
output(/*INPUT*/ grade);