Back to TA Page

Mobius strip

Assignment 7 (Extra Credit)

Chin's Assignment 7 webpage

Chin's solution: HTML version | Java version

This assignment is out of 10 points. The following is how the grading breaks down.

Originial Code: 10%

  • You sent me something more than just Chin's code.

Compiles: 30%

  • 3 points just if it compiles.

Exception classes: 20%

  • Did you write the 6 required exception classes?

Throws: 25%

  • Whether you threw each of the 5 throwable exceptions. (5% each, which is 0.5 points each)
  • If you had code that threw it at all, you got .2/.5
  • If your code actually threw it at the proper time in the test run, then you got the full .5.

Catches: 15%

  • You were requested to catch all exceptions in main() or nearby (in one of its subfunctions).
  • If you caught the exception somewhere, .1/.3
  • If you caught it in main as requested, then you got the full .3/exception.

Comments

Since this was extra credit (and time was short and the code was long), I graded this mostly with a script and a Java test program. The program connected CircuitElements together and produced the 5 different cases when an exception should be thrown and tested to see if you threw the required exception. (This is why you shouldn't be catching exceptions in places other than main() or other high-level funtions; you don't know how your code will eventually be used, so you should pass exceptions up the line when it makes more sense to do so.)

If my comments say "Bad throw" it means that, though you had code to throw it, when the test case actually ran, no exception of that type came out when it should have.

My abbreviations are pretty obvious, but here they are anyway:

  • MOE == MissingOutputsException
  • IWVE == InvalidWireValueException
  • TFIE == TooFewInputsException
  • TMIE == TooManyInputsException
  • ILE == InfiniteLoopException