Can someone help me with this probelm using the instuctions
Can someone help me with this probelm, using the instuctions below,
Problem Statement
Review the Area01.java program found in this weekly module. Run it under Eclipse and note how it computes the area and perimeter of a rectangle from the sides entered by the user. Then modify the program to also find the area and circumference of a circle from the radius entered by the user. And finally, find the area and perimeter of a triangle from the base and height entered by the user. A typical session might look like this:
Enter the first side (as a decimal): 20.5
Enter the second side (as a decimal): 15.0
The area is 307.5
The perimeter is: 71.0
Enter the radius (decimal): 30.2
The area is:2,865.2557
The circumference is: 189.752
Enter the height of the triangle (decimal): 3.0
Enter the base of the triangle (decimal): 4.0
The area is: 6.0
The perimeter is 12.0
Procedure:
Locate the program Area01.java in your files and edit with .
Change the author from me (j. dzuback) to you (your name).
Save the program with the file name xxPLP04.java where xx are your initials. Be sure to change the class name to this as well (to avoid the run-time error \"class not found\" message).
Modify the program as indicated in the Problem Statement above.
Compile the program and correct any syntax errors detected by the compiler.
When the syntax errors have been corrected, test the program in console facility. You should, before testing, create test data and perform the computations manually to serve as your control.
Compare the results produced by your program with your hand derived results.
Using the commenting facility, put your test data at the end of the program file.
Submit the source program file for evaluation, feedback and credit.
Notes:
When deciding on the data type to use for your sides (rectangle), radius (circle), base and height (triangle) consider how you will use them and the numeric types that will be used in the computations.
Declare PI as a named constant and assign it the value of 3.14159 at the time of declaration.
Notice that the example above strongly suggests that your program will require a series of interactions with the user in order to gather data for each set of shape calculations.
Assume you will be working with a right triangle (a triangle of 90 degrees).
Some calculations you may find useful:
for the perimeter of a rectangle:
perimeter = 2 * (side1 + side2)
for the circumference of a circle:
circumference = 2 * PI * radius
for the perimeter of a triangle:
perimeter = base + height + hypotenuse
to find the hypotenuse of the right triangle:
hyptenuse2 = base2 + height2
Solution
Please find the required program along with its output. Please see the comments against each line to understand the step.
-----------------------------------------------------
OUTPUT:
Enter the first side (as a decimal):
20.5
Enter the second side (as a decimal):
15
The area is 307.5
The perimeter is: 71.0
Enter the radius (decimal):
30.2
The area is:2865.2557435999997
The circumference is: 189.75203599999998
Enter the height of the triangle (decimal):
3
Enter the base of the triangle (decimal):
4
The area is:6.0
The perimeter is 12.0

