Write a simple script that will calculate the volume of a hollow sphere,

4pi/3(r0^3-ri^3)

where ri is the inner radius and r0 is the outer radius. assign a value to a variable for the inner radius, and also assign a value to another variable for the outer radius. then, using these variables, assign the volume to a third variable and include comments in the script.

Using r0= 8.5, and ri=6.5 to do calculation, and test your script.

Then,rewrite the script in problem 6 as a function. The function has two input arguments, ri and r0, and one output argument, volume. Using r0= 8.5, and ri=6.5 to do calculation, and test your script.

    • 10 years ago
    100% Correct answers
    NOT RATED

    Purchase the answer to view it

    blurred-text