Home CPSC 240

Lab 6: Debugging Exercise

 

Objective

To get practice fixing compiler errors and debugging runtime errors.


 

Task

For this lab you will fix the Quiz.java program. It tries to read in a list of quiz scores, drop the lowest score, and then return the average of the remaining grades.

It uses a file called scores.txt which you can download and test with. The test file doesn't have any problems and you can assume it will be there when the program runs.

The program itself, however, has a couple of compiler errors, as well as some run-time logic errors in it. Some of these run-time problems will be exceptions that crash the program and one is a logic error that results in the wrong output. Your job is to fix these problems and get the code working.

When you are done, the example file should give the following output:

$ java Quiz
Average is 4.5

 

Submitting

When you are done, please submit the Java code under the assignment in Canvas.

Copyright © 2022 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.