Design a Geometry class with the following methods:
- A static metod that accepts the radius of a circle and returns the ares f the circle. use the following formula.
The math.PI for Area=π and the radius of the circle for r.
- A static method that accepts the length and width of a rectangle and returns the area of the rectangle. Use the follow forumula.
Area = length x width
- A statuc method that accepts the length of a triangle's base and the triangles height. The method should return the area of the triangle. Use the following formula.
Area= base x height x 0.5
The methods should display an error message if negative values are used for the circles radius, the rectangle's length or width, or the triangle's base or height.
Next write a program to test the class, which displays the following menu and responds to the user's selection:
1. Calculate the Area of a Circle
2. Calculate the Are of a Rectangle
3. Calculate the Area of a Triangle
Enter you choice (1-4):
Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu.
Turn in the Java source code (.java) files Geometry.java and GeometryCalc.javaAttachments
//Prompt for base and height
System.out.print("Enter base: ");
double base = scanner.nextDouble();
System.out.print("Enter height: ");
double height = scanner.nextDouble();
//Calculate triangle area
area = Geometry.areaOfTriangle(base, height);
//User chose to exit