Question: Exercise 2: Design and implement a Java program (name it ComputeAreas) that defines four methods as follows Method squareArea (double side) detemines and returns the

 Exercise 2: Design and implement a Java program (name it ComputeAreas)

Exercise 2: Design and implement a Java program (name it ComputeAreas) that defines four methods as follows Method squareArea (double side) detemines and returns the area of a square Method rectangleArea (double width, double length) detemines and retums the area of a rectangle Method circleArea (double radius) determines and returns the area of a circle Method triangleArea (double base, double height) determines and returns the area of a triangle Test the methods with different input value read from the user (all input and output is hand led by the main method) Design the main method of your program such that it allows the user to select one shape for each run and to re- run the program with different inputs (i.e., use a loop structure). Document your code and organize and space the outputs properly. Use appropriate formatting techniques to organize the outputs. Sample outputs, for shape types selected by the user, are square side Square Area 5.1 26.01 Rectangle width = 4.0 Rectangle Length 5.5 Rectangle Area22.0 Circle Radius - Circle Area Triangle Base - Triangle Height-3.6 Triangle Area - 19.635 6.4 11.52

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!