Homework 3, Grades.
Short Description:
Write a program that will compute your grade for this class.
Goals
When you finish this homework, you should have:
- Demonstrated your ability to design/implement/employ functions.
- Demonstrated your ability to deal with floating point numbers.
Formal Description
For this project, you are to create a program that will calculate your grade for this class.
Your program should start by requesting the name of a file containing grade data for the semester. You may assume that the file name will be correct.
Your file ineraction shold be exactaly three lines:
- The phrase "Enter a file name: "
- The statement "Opening ", followed by the file name
- A blank line.
Enter a file name: Bob_Smith.dat
Opening Bob_Smith.dat
Please note, your output will look differently when running interactively. You will have an extra newline between the prompt and the opening statement. This is because the input will be reflected in the terminal. On the screen your output will look like this:
[bennett@mirkwood closed]$ gradebook
Enter a file name: Bob_Smith.dat
Opening Bob_Smith.dat
Grade Report for: Bob Smith
...
This file is in the following format:
From this file you should compute the student's averages for each component as well as for the class, and the student's letter grade.
You should print this information in the following format:
Enter a file name: Bob_Smith.dat
Opening Bob_Smith.dat
Grade Report for: Bob Smith
Homework Average: 84.3%
Groupwork Average: 89.1%
Test Average: 91%
Final Exam: 90%
Class Average 88%
Letter Grade: B
- The homework and groupwork averages should be accurate to one decimal place.
- Tests, exam and class averages should be printed with no decimal places.
- All values should be rounded properly
- If a component is not present, print "Not Present"
Enter a file name: Susan_Lee.dat
Opening Susan_Lee.dat
Grade Report for: Susan Lee
Homework Average: 92.0%
Groupwork Average: 80.0%
Test Average: Not Present
Final Exam: Not Present
Class Average 88%
Letter Grade: B
Computing the Class average:
- For each category, compute the average as shown above.
- Form a weighted average
- homework percent * homework weight + groupwork percent * groupwork weight + test percent * test weight + final percent * final weight
- Divide this by the sum of the weights present
- Example:
- .8428 * 40 + .891 * 20 + .91 * 30 + .9 * 10 = 87.83
- 87.73 / (40 + 20 + 30 +10 ) = .8783 = .88 = 88%
- Example 2:
- .92 * 40 + .80 * 20 = 52.8
- 52.8/(40 +20) = .88 or 88%.
- Notice since tests and final were missing, they were not included in the computation.
Notes
- Your code must compile with the following flags
- Be warned, the examples are only examples, the data used to test your program will change.
- All data will be valid, as described above.
- But quantities and values will be different.
- DO NOT BUILD YOUR PROGRAM with the values above hard coded as data. Read from a file.
- Your program should produce NO output other than the requested output above.
- The given data files:
- The given output files
- Any missing data should be labeld with "Not Present"
- If the student has not completed any elements of the class, the class average and the letter grade should also be reported as "Not Present".
- Your program must compile and run on devweb1.cis.pennwest.edu
- Your program must be well documented.
- Your program must include at least four functions, but more would be better.
- Your program should follow all standards for style discussed in class and in the style guide.
Required Files
A single source code file.
Submission
Submit the assignment to the D2L folder Homework 3 by the due date.