CIS 35A: Introduction to Java Programming

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

Lab #3 (Exercise 4-3)

Enhance the Test Score application

Due Date: Thursday of Week 1
10 points

Before you start, check which team you belong to.

In this lab, you'll enhance the Test Score application so it uses a while or a do-while loop plus a for loop. After the enhancements, the console for a user's session should look something like this:

  1. Open the EnhancedTestScoreApp done in lab #2.
  2. Change the while statement to a do-while statement, and test this change. Do this work any better than the while loop?
  3. Enhance the program so it uses a while or a do-while loop that controls whether the user enters more than one set of test scores. The statements in this loop should first ask the user how many test scores are going to be entered. Then, this number should be used in a for loop that gets that many test score entries from the user. When the loop ends, the program should display the summary data for the test scores, determine whether the user wants to enter another set of scores, and repeat the while loop if necessary. After you make these enhancements, test them to make sure they work.
  4. If you didn't already do it, make sure that the code in the for loop doesn't count an invalid entry. In that case, an error message should be displayed and the counter decremented by one. Now test to make sure this works.

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.