CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades | Students

Assignment #14

Accumulate test scores

Due Date: Monday of Week 6
20 points

This project requires a basic GUI with a somewhat complicated action listener.

Console

Operation

  • The user enters test scores one at a time and then clicks the Enter Score button.
  • For each entered score, the application adds one to the number of scores, calculates the average score, and determines what the best score is so far. Then, it displays the number of scores, average score, and best score in the three disabled text fields.
  • The user can click the Clear button to reset everything to zero.
  • When the user closes the frame or clicks the Close button, the application exits.

Specifications

  • The average score is the sum of all scores divided by the number of scores.
  • Assume valid data is entered.

Hint

  • If you have trouble getting the labels and text fields to line up properly, try adjusting the frame size. When you use the Flow layout manager, the width of the frame affects how components you add to the frame are lined up.

Enhancement

  • Add data validation by catching the exception that's thrown when the user enters invalid data.
Include in your program the following comments:
  • Name of program
  • Programmer's name
  • Current Date
  • Computer system and compiler you are using
  • Brief description of the program

Compile and run the Java program.

Take a screen capture by hitting simultaneously the keys Alt and Print Screen (Prt Sc) of the output results (console) and paste it in MS Paint. Save it as a gif file.

When you are ready, upload the java program and the gif file by clicking the link below:

Upload Assignment

I cannot grade if I don't get the files and receive your email.