CPSC 170 Post Lab 4: Grade Point Average
Due Tuesday, Feb 19
Write an applet that computes the user's grade point average. Use Labels
and Textfields to instruct the user to enter the number of As, Bs, Cs, Ds, and Fs
that he or she has earned. Have a button that says "Compute GPA" so that
when the user presses the button, the GPA is displayed.
Notes:
- Play around with the layout to get it to look nice. Note that you
can set the size of Labels and TextFields with the setSize(length, width)
method.
- Default the TextField text to 0 so that the user doesn't have to
enter a value if no such grades have been earned.
- Remember how to compute a GPA: an A is worth 4 points, a B 3, a C 3,
a D 1, and an F 0. Just multiply the point value by the number of each
grade, add, and divide by the total number of grades. Voila!
What to turn in
Turn in hardcopy and e-mail a
tar file of your postlab directory to
bloss@cs.roanoke.edu. IMPORTANT:
Put "Postlab 4" (no quotes) in the subject.