CS 305J Assignment, Parameters
| Programming Assignment 4 | Individual Assignment. You must complete this assignment by
yourself. You cannot work with anyone else in the class or with someone
outside of the class. You are encouraged to get help from the instructional
staff. Placed online: Wednesday, September 17 |
||||||
| Introduction | The purposes of this assignment are:
Create a program that calculates a student's final grade in a course based on their homework and exam grades. The following is one example log of execution of the program. User input is in bold and underlined.
This program calculates the course average for a student based on input from the program user. A student's course average is a weighted average of homework and exam scores. To compute the weighted average for a category, the student's points earned in a category is divided by the total points for that category and multiplied by that category's weight. Each homework is worth 20 points, although students may earn more than 20 points on a homework. Each exam is worth 100 points. Students may not earn more than 100 points on an exam. Consider the example from above: There are 4 homeworks and 2 exams. The student's homework scores are 20, 18, 20, and 15. The students exam scores are 88 and 95. The homework is worth (weighted) 35% of the final course grade and the exams are worth 65% of the final course grade. It is only necessary to enter the homework weight. The exam weight will be calculated based on the homework weight. The following calculations produce the student's course grade from the above log of execution:
Note that the preceding equations are not Java expressions. In Java, an integer expression such as (88 + 95)/(100 * 2) = 183 / 200 would evaluate to 0. We can ensure floating point division occurs by make one of the terms a double. For example the Java expression (88 + 95) / (100.0 * 2) => 183 / 200.0 => 0.915. Floating point division occurs here because one of the operands of the division operator is a floating point number. The program behaves differently depending on the user input it receives; you should look at all of the example logs of execution on the course web site to get a more comprehensive example of the program's behavior. |
||||||
| Program Behavior Description |
|
||||||
| Stylistic Guidelines |
|
||||||
| Tips |
When finished turn in your Grades.java program using the turnin program. |
||||||
| Files |
|
||||||
| Checklist | Did you remember to:
Based on an assignment by Marty Stepp. Thanks to Marty for letting me borrow his ideas. |