Ok am new in java programming and I am trying to conduct a simple class called Area.
If anyone know anything about java you can help me.

I am writing a class that has three overloaded static methods for calculating the area of the following geometric shapes.


These are the formula for calculating the area of the shapes.

Area of a circle: Area= (TT)(r^2)
where TT is Math.PI and r is the circle radius

Area of a Rectangle: Area= (width) * (length)

Area of a cylinder: Area= (TT)(r^2)(h)
where TT is Math.PI and r is the cylinder's base, and h is the cylinder's height

Because the three methods are to be overloaded, they should each have the same name, but different parameter lists. I want to demonstrate the class in a complete program

Recommended Answers

All 2 Replies

That is a nice homework assignment. We do not do your homework for you. Show what work you have done on it, mainly code, and then maybe you will receive some help.

By the way the formula for the cylinder is wrong. The one you wrote calculates the volume
The right is : (πr^2) * 2 + h*2πr

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.