Homework 6 Grading Guide

On many of these problems you will need to use your judgement to decide how much partial credit to assign, since it's hard to predict in advance what types of mistakes will be made on the various problems.


  1. (5 points)

  2. (5 points)

  3. (5 points)

  4. (5 points)

  5. (5 points)

  6. (35 points): Eyeball the source code and make sure that exception handlers were used to handle the two exceptions in this problem. Deduct the full 35 points for not using exception handlers. Run the program and check the following situations:

    1. 6 points: The program runs correctly on valid input (e.g., 10 30 40)
    2. 3 points: The program gives an error message on a negative number (e.g., 10 -1 40) and sums the rest of the line
    3. 12 points: If the program is initially given a bad filename, it repeatedly prompts the user for a valid filename until it is given one.
    4. 14 points: The program gracefully handles a non-integer in the input by:
      1. 7 points: printing a nice error message
      2. 7 points: summing the remaining items in the line and printing their sum. Try a test case that has both a single non-integer, and multiple non-integers.

  7. (40 points):
    1. (32 points) Execution: Run the jar file and make sure that the following situations are handled properly:
      1. (8 points) Valid input
      2. (12 points) Queue Overflow
      3. (12 points) Queue Underflow (removing from an empty queue)
    2. Eyeball the code and make sure that
      1. (5 points) The scanner objects used to read lines are closed after each line of input is read. If there are multiple close statements, rather than a single one in a finally clause, then deduct 4 points.
      2. Exception handlers are used for error handling: deduct the full 40 points for not using exception handlers
      3. (3 points) Exceptions are thrown out of the queue class and handled by the driver class.