Question: Write a Java class. The class name must be ShapeMetrics, which means the file name must be ShapeMetrics.java. All of the required formulas may be
Write a Java class. The class name must be ShapeMetrics, which means the file name must be ShapeMetrics.java. All of the required formulas may be found in Wikipedia. Satisfy the following requirements by including the required comment and providing the following methods:
-
Include the required academic integrity comment (provided below). Solutions which lack this comment will not be graded.
-
getAreaOfRectangle(), with two float arguments, width and height, in that order, returning a float value which is the area of the rectangle with that width and height.
-
getDiagonalOfRectangle(), with two float arguments, width and height, in that order, returning a float value which is the diagonal of the rectangle having those dimensions.
-
getPerimeterOfRectangle(), with two float arguments, width and height, in that order, returning a float value which is the perimeter of the rectangle having those dimensions.
-
getRadiusOfCircle(), with two float arguments, chord and sagitta, in that order, returning a float value that is radius of the circle having those dimensions.
-
getEccentricityOfEllipse(), with two float arguments, major axis and minor axis, in that order, returning a float value that is the eccentricity of the ellipse that has those dimensions.
-
getAreaOfEllipse(), with two float arguments, major axis and minor axis, in that order, returning a float value that is the area of the ellipse that has those dimensions.
-
getDistanceBetweenPoints(), with FOUR float arguments x1 and y1, for the first point, and x2 and y2, for the second point, in that order, returning a float value that is the distance between two points in 2-dimensional space.
-
getVolumeOfCylinder(), with two `float arguments, the radius and height of a cylinder, in that order, returning a float value that is the volume of the cylinder having those dimensions.
All functions must be public and static. Do not put a main() function or any print statements in your class. They are not needed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
