Question: 2 Practical Concepts Create a Java program called that computes the area of two shapes; rectan- gles and circles, through two overloaded methods. 2.1 Write
2 Practical Concepts Create a Java program called that computes the area of two shapes; rectan- gles and circles, through two overloaded methods. 2.1 Write a method called "computeArea" that accepts two double param- eters to compute the area of a rectangle and display the result. Note: Area = length * width 2.2 Overload the "computeArea" method in such a way that it accepts one double parameter to compute the area of a circle and display the result. Note: Area = * * radius? 2.3 In the main method, let the user enter the length and width of a rectangle, then invoke the method "ComputeArea" by passing the parameters entered by the user. Similarly, let the user enter the radius of circle, then invoke the method again by passing the right parameter. The following figure shows a sample output. Problems Javadoc Declaration Console X Please enter the length: Please enter the width: The area of the rectangle is 1887.50 Please enter the radius: The area of the circle is 113.10 75.5 25 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
