Using Java Language
Add a class Octagon to work with the Shape, Triangle, Rectangle classes. An octagon has eight sides that you can assume are all the same length. (Hint: how many attributes will this class need then? Can we use just one? ). The area of an octagon is : side * side. The class should have get and set methods, toString, equals, and area and perimeter methods. It should have a no-args (defaulto parameter) constructor as well as one that takes a double for the side length. The default side length should be 1.0 a. Draw a UML diagram for the class. b. Code the class. c. Create a test program that has the following: A method that generates an array of n Octagons, that have random side lengths in the interval [a,b). nga and b should be parameters for the method. A method that prints the array. A method that returns the index of the largest octagon, where you use side length as the determinant it "larger". A main method that tests each of these methods by calling them one or more times. Add a class Octagon to work with the Shape, Triangle, Rectangle classes. An octagon has eight sides that you can assume are all the same length. (Hint: how many attributes will this class need then? Can we use just one? ). The area of an octagon is : side * side. The class should have get and set methods, toString, equals, and area and perimeter methods. It should have a no-args (defaulto parameter) constructor as well as one that takes a double for the side length. The default side length should be 1.0 a. Draw a UML diagram for the class. b. Code the class. c. Create a test program that has the following: A method that generates an array of n Octagons, that have random side lengths in the interval [a,b). nga and b should be parameters for the method. A method that prints the array. A method that returns the index of the largest octagon, where you use side length as the determinant it "larger". A main method that tests each of these methods by calling them one or more times