Your instructor will assign one or more of the following problems. Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files.

IMPORTANT: In each of the exercises below you are extending existing code. Begin by using Eclipse to make a copy of your existing Java package, and then paste the copy into your "src" directory. Eclipse will prompt you to rename the copy of the package, which you should do in the usual way (i.e. ``` edu.calvin.yourLoginID.homework10 ``` ).

1. Extend the circle class you built in the lab exercise as follows:

• `changeDiameter()` - Add a mutator that changes the diameter of the circle by a given amount. Be sure to maintain the class invariant using exceptions.
• Add two object-interaction methods to the circle class:
• `overlaps()` - Write a method that determines if a circle object overlaps another circle object.
• `contains()` - Write a method that determines if a circle object contains another circle object.
Hint: These two methods can profitably make use of a Java-based version of the `computeDistance()` method we developed earlier in the course.
• Add unit test cases to exercise the new features of the circle class. Be sure to include test cases that exercise the throwing of errors in the appropriate places.
2. Modify the fraction class you built in the previous lab as follows:

• Modify it to maintain its invariant by throwing exceptions;
• Add unit test cases to exercise the key functionality of the class.
3. Modify the quadratic class from the previous homework as follows:

• Maintain the class invariant by throwing an exception.
• Add two methods, one that computes the larger root of the equation, and one that computes the smaller. In each case, throw an appropriate exception if real valued roots do not exist. You will need to use the quadratic equation:  −b ± √   b2 − 4ac 2a
• Create unit test cases to exercise the key functionality of the class.

# Checking In

Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files. We will grade this exercise according to the following criteria:

• Correctness:
• 25% - Basic functionality - Include the basic class definition with the appropriate instance variables, constructors, accessors, mutators and object-interaction methods.
• 30% - Exceptions - Include the appropriate exception handling for your main class.
• 30% - Testing- Include appropriate unit tests for the features of your main class.
• Understandability:
• 5% - Code Documentation - Separate the logical blocks of your program with useful comments and white space.
• 5% - Header Documentation - Document the basic purpose, authors and assignment number for your main class and unit test class.
• 5% - Method Documentation - Each method should have appropriate documentation.

If you work in teams for this homework assignment, be sure to submit all team members’ names in the code documentation.