Java program that Has an object class named RegOct that is a concrete subclass of the Shape
Question:
Java program that Has an object class named RegOct that is a concrete subclass of the Shape class from attached chapter 4 attachments that represents an Regular Octagon. The class must include appropriate implementations of the required abstract methods. The class must override toString() in a descriptive fashion, displaying any instance variables and the area, each labeled unambiguously. The string must easily fit on one line of the console. Add constructors/accessors/mutators for all instance variables. Retain the default Comparable logic for Shape and RegOct. 6. Performs the following tasks in the main() of RegOct: a. Declare and instantiate an instance of an RegOct array and insert at least 20 of your octagon instances, each constructed with a random (double) dimension. b. Display the contents of the array after the octagons have been inserted, one instance per line. Precede the output with a descriptive heading. c. Sort the octagons in place in ascending order using a static method you write named Sort that takes a Comparable array as its lone parameter. (More details below.) d. Display the sorted array contents, one instance per line, with a descriptive heading and whitespace separation from the unsorted group. Your sort algorithm can be any standard sort that is neither Bubble Sort nor a Bogosort.
Put both classes in a package.
copy the Shape class from attached chapter 4 attachments and put it in that package
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill