Answer to Question #257071 in Java | JSP | JSF for Shan

Question #257071
Java program Create a class “Area” to calculate the area of rectangle, triangle and circle by simply using class syntax through objects.
1
Expert's answer
2021-10-27T00:25:56-0400
public class Area {
    public double rectangleArea(double width, double height) {
        return width * height;
    }

    public double triangleArea(double base, double height) {
        return base * height * 0.5;
    }

    public double circleArea(double radius) {
        return Math.PI * radius * radius;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS