mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
Fix spelling in Volume (#3893)
This commit is contained in:
@ -1,24 +1,24 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
/* Find volume of various shapes.*/
|
||||
/* Calculate the volume of various shapes.*/
|
||||
public class Volume {
|
||||
|
||||
/**
|
||||
* Calculate the volume of a cube.
|
||||
*
|
||||
* @param sideLength side length of cube
|
||||
* @return volume of given cube
|
||||
* @param sideLength length of the given cube's sides
|
||||
* @return volume of the given cube
|
||||
*/
|
||||
public static double volumeCube(double sidelength) {
|
||||
return sidelength * sidelength * sidelength;
|
||||
public static double volumeCube(double sideLength) {
|
||||
return sideLength * sideLength * sideLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the volume of a cuboid.
|
||||
*
|
||||
* @param width of cuboid
|
||||
* @param height of cuboid
|
||||
* @param length of cuboid
|
||||
* @param width width of given cuboid
|
||||
* @param height height of given cuboid
|
||||
* @param length length of given cuboid
|
||||
* @return volume of given cuboid
|
||||
*/
|
||||
public static double volumeCuboid(double width, double height, double length) {
|
||||
@ -28,7 +28,7 @@ public class Volume {
|
||||
/**
|
||||
* Calculate the volume of a sphere.
|
||||
*
|
||||
* @param radius radius of sphere
|
||||
* @param radius radius of given sphere
|
||||
* @return volume of given sphere
|
||||
*/
|
||||
public static double volumeSphere(double radius) {
|
||||
@ -38,8 +38,8 @@ public class Volume {
|
||||
/**
|
||||
* Calculate volume of a cylinder
|
||||
*
|
||||
* @param radius radius of the floor
|
||||
* @param height height of the cylinder.
|
||||
* @param radius radius of the given cylinder's floor
|
||||
* @param height height of the given cylinder
|
||||
* @return volume of given cylinder
|
||||
*/
|
||||
public static double volumeCylinder(double radius, double height) {
|
||||
@ -49,7 +49,7 @@ public class Volume {
|
||||
/**
|
||||
* Calculate the volume of a hemisphere.
|
||||
*
|
||||
* @param radius radius of hemisphere
|
||||
* @param radius radius of given hemisphere
|
||||
* @return volume of given hemisphere
|
||||
*/
|
||||
public static double volumeHemisphere(double radius) {
|
||||
@ -59,9 +59,9 @@ public class Volume {
|
||||
/**
|
||||
* Calculate the volume of a cone.
|
||||
*
|
||||
* @param radius radius of cone.
|
||||
* @param height of cone.
|
||||
* @return volume of given cone.
|
||||
* @param radius radius of given cone
|
||||
* @param height of given cone
|
||||
* @return volume of given cone
|
||||
*/
|
||||
public static double volumeCone(double radius, double height) {
|
||||
return (Math.PI * radius * radius * height) / 3;
|
||||
@ -70,22 +70,22 @@ public class Volume {
|
||||
/**
|
||||
* Calculate the volume of a prism.
|
||||
*
|
||||
* @param area of the base.
|
||||
* @param height of prism.
|
||||
* @return volume of given prism.
|
||||
* @param baseArea area of the given prism's base
|
||||
* @param height of given prism
|
||||
* @return volume of given prism
|
||||
*/
|
||||
public static double volumePrism(double basearea, double height) {
|
||||
return basearea * height;
|
||||
public static double volumePrism(double baseArea, double height) {
|
||||
return baseArea * height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the volume of a pyramid.
|
||||
*
|
||||
* @param area of the base.
|
||||
* @param height of pyramid.
|
||||
* @return volume of given pyramid.
|
||||
* @param baseArea of the given pyramid's base
|
||||
* @param height of given pyramid
|
||||
* @return volume of given pyramid
|
||||
*/
|
||||
public static double volumePyramid(double basearea, double height) {
|
||||
return (basearea * height) / 3;
|
||||
public static double volumePyramid(double baseArea, double height) {
|
||||
return (baseArea * height) / 3;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user