Create a Java program based on the geometric shapes ex described at the beginning of this lesson using Classes Square, Triangle, Rectangle, and Circleto help describe inheritance and polymorphism using the perimeter() method. The program will find out the perimeter of a designated shape.
The program should begin by prompting you for the shape you want to find out the perimeter for-square, rectangle, circle, or triangle. You can designate 1-square, 2-rectangle, 3-circle, 4-triangle, and 5-Exit program.
Once you select your shape, then the program should prompt you for enough information to find out the perimeter of the chosen shape. For ex, if you select square then the program should prompt you for the length of one side of the square. If you select circle, then the program will prompt you for either the radius or diameter of the circle. With the information for calculating the perimeter, have the program complete the calculation and print the information to the screen, using one of the JOptionPane output classes (methods) or any other graphical output method.