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 thearea of four different geometric shapes: triangles, squares, rectangles, and circles. You

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!