Exercise 10: Interfaces

Copy the Circle.java file that you created as your Exercise 6 solution into the directory exercises/ex10 in your cloned repository. Then download Money.java and Ex10.java into that same directory.

Modify the Circle and Money classes so that they conform to the UML diagram below. This means you will need to create Writeable, and you will also need to add the specified method to the two classes. You should not remove any of the existing features of those classes.

Interface and classes used in Exercise 10

Note also the following points:

To help you check whether you have implemented all of this correctly, you can use the program in Ex10.java. If you compile and run this program, it should generate the following output:

Money: €2.07
Money: €11.80
Circle: r=6.3952

When you are confident that your solution is working as required, go to Submit My WorkExercises 6-10Exercise 10 in Minerva to submit the three files Circle.java, Money.java and Writeable.java. You can improve your solution and resubmit as many times as you like until the deadline. Also, don’t forget to commit all your work to your Git repository and push those commits up to GitLab.