Developing an Application – Grade Calculator for CS139

advertisement
Developing an Application – Grade Calculator for CS139
Problem – You need to calculate final grades for students in CS139. The final grade is
composed of a series of lab, homework, and in-class activities, 2 midterms, and a final
exam (for our purposes the Programming Assignments are being lumped with the labs).
Grades are computed on the basis of a weighted grading scheme as follows:
Labs: 40%
Midterm 1: 15%
Midterm 2: 20%
Final Exam: 25%
The lab grade is applied to the average score of all of the labs (etc) submitted. Two of the
grades in the lab category are dropped before the final average is calculated.
Process
1. You decide you need two classes, a Grade139 class which will hold the grade
information for a single student and a GradeInput class which will do the input
and output.
2. The GradeInput class will have a method with a menu, allowing the professor to
enter grades. There are two ways that the professor can enter grades…they can
either enter all of the grades for one student at one time, or they can enter grades
for each individual item for all students. Your menu must accommodate either of
these two methods.
3. GradeInput will also be concerned with validity. Grades must all be in the range
of 0 – 110 inclusively (could this change?). Grades outside of this range should
result in an error message and the user reprompted until the grade is entered that
is both a double number and is a number in the expected range.
Focus on GradeInputOutput
1. What data do you need? What will the names and datatypes be of each of these
elements. This data will be the attributes of the class. Are each of these base data
or are some of them derived values? Make sure that you are dealing only with
base (raw) data.
2. Let’s refine the specifications. What should our menu structure look like? Do we
want a single tiered or two tiered menu? What about its behaviors? How will we
know how many Grade139 objects to build? At what point should we prompt for
that?
3. What should a constructor initialize?
4. Do we need any set or get methods? Remember the focus of this class will be to
perform input and output operations.
5. What method will be our starter? Do we need a method to display the menu?
How about making valid choices?
6. What method will carry out the actions?
7. What will be displayed when we have entered all of the grades for all of the
students?
8. Finally, what will your validation method (methods) look like?
9. Any other considerations?
Download