CIS 35A: Introduction to Java Programming

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

Lab #2 (Exercise 3-2)

Modify the Test Score application

Due Date: Wednesday of Week 1
10 points

Before you start, check which team you belong to.

  1. If you downloaded the file, open the file named TestScoreApp.java that's in your computer or USB drive. Save the program as EnhancedTestScoreApp.java. Change the class name to EnhancedTestScoreApp. If you don't have the file, copy and paste the code below:
  2. Use the += operator to increase the scoreCount and scoreTotal fields. Then, test this to make sure that it works.
  3. As the user enters test scores, use the methods of the Math class to keep track of the minimum and maximum scores. When the user enters 999 to end the program, display these scores at the end of the other output data. Now test these changes to make sure that they work.
  4. Change the variable that you use to total the scores from a double to an int data type. Then, use casting to cast the score count and score total to double as you calculate the average score and save that average as a double. Now test that change.
  5. Use the NumberFormat class to round the average score to one decimal place before displaying it at the end of the program. Then, test this change.Note that the rounding method that's used doesn't matter in a program like this.

Include in your program the following comments:

  • Name of program
  • Team's name with all the names of the members (e.g. Team A: John Doe, Jane Smith, etc.)
  • 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 Lab

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