Lab 10 Solution

$30.00

Description

This lab will focus on exception handling. We will be revisiting Assignment 4 to give you some experience with this task. You will write three small classes that extend Runtime Exception.

The Exception classes you will create are listed below. I have also included the message these exceptions should display when thrown.

InvalidAddMovieAtIndexException

o Message: Invalid index for addMovieAt.

InvalidGetMovieAtException

o Message: Invalid index for getMovieAt.

InvalidRemoveMovieAtIndexException

o Message: Invalid index for removeMovieAt.”

I have placed TODO markers in the MovieCollection class where you will need to throw the correct exception for each method.

You also will need to add a few lines of code to the Junit tests. Read the description by the //TODO

marker.

When complete and all Junit tests pass, show your TA to be marked off for this lab.