//static method for KingWish calculation class KWcalc { static double PI = Math.PI; public static float totalPrice(double radius, float plaCost, float diaCost) { float totalCost; double SphereVolume = (4.0*PI*radius*radius*radius)/3.0; // To calculate the volume of the sphere double SurfaceArea = 4.0*radius*radius*PI; // To calculate the Surface area of the sphere float costofplatinumball = (float)SurfaceArea*plaCost; // Casting Surface Area from double to sphere float costofdiamondstuffing = (float)SphereVolume*diaCost; // Casting sphere volume from double to float totalCost = costofdiamondstuffing+costofplatinumball; return totalCost; } }//end KWcalculation