This time you will be writing three functions to assist in program. The first function is provided
float
cube
(
float
number){
return
number * number * number;
}
float
calcVolume
(
float
radius){
//Your code here
}
// Hint to convert from cubic inches you divide cubic inches by 12^3
float
convertToCubicFt
(
float
number){
//Your code here
}
//Diameters in inches
int snowmanDiameter[
6
] = {
80
,
46
,
35
,
24
,
20
,
10
};
Formula for the Volume of a Sphere
Pi = 3.14(This is sufficient precision)
R = Radius or 1/2 of the Diameter
You need to use a
for
loop to calculate your total.
Approximate Output
(Your answer will be exact)
Approx
200
cubic feet