Question: Methods: Area Calculator Write a program using Java to calculate the area of four different geometric shapes: triangles, squares, rectangles, and circles. You must use


Methods: Area Calculator Write a program using Java to calculate the area of four different geometric shapes: triangles, squares, rectangles, and circles. You must use functions. Here are the functions you should create: public static double area_circle( int radius ) //returns the area of a circle public static int area_rectangle( int length, int width ) // returns the area of a rectangle public static int area square( int side ) // returns the area of a square public static double area_triangle( int base, int height ) // returns the area of a triangle Your program should present a menu for the human to choose which shape to calculate, then aslk them for the appropriate values (length, width, radius, etc.). Then it should pass those values to the appropriate function and display the resulting area. Notice that you must not input the values inside the functions, and you must not display the values inside the functions. All input and output must be in the mainc), and values must be passed to the functions and returned from them shape formula square rectangle triangle circle A = Yabh A nr2 You'll need the value of called Math.PI for area-circle ( ); feel free to use the built-in double variable The menu should keep looping until the human chooses to quit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
