Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Java program based on the geometric shapes example described at the beg

ID: 3541885 • Letter: C

Question

Create a Java program based on the geometric shapes example described at the beginning of this


lesson using Classes Square, Triangle, Rectangle, and Circle to help describe inheritance and


polymorphism using the circumference() method. The program will calculate the circumference of a


designated shape.



Make sure you create the program in a loop and have the program prompt you for another shape and


calculation. Enter 5 for exit.



You should first create a Square superclass, and then from it create Rectangle, Circle, and


Triangle subclasses. In the Square class create a circumference() method (e.g., circumf()) and then


re-define that method in each subclass to calculate the area of the appropriate shape.



Also, you should now be using the JOptionPane.showMessageDialog() method (or something similar) for


displaying your output instead of System.out.println().


System.out.println().



The program should begin by prompting you for the shape you want to calculate the circumference


for

Explanation / Answer