Create a java program based on the geometric shapes


Create a Java program based on the geometric shapes example 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 calculate the perimeter of a designated shape.
The program should begin by prompting you for the shape you want to calculate 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 calculate the perimeter of the chosen shape. For example, 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.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Create a java program based on the geometric shapes
Reference No:- TGS0128980

Expected delivery within 24 Hours