The volume of a sphere with radius 𝑟 is given by the formula 𝑉 = ⋅ 𝜋 ⋅ 𝑟3 . In this problem you will calculate the volume
3
of spheres with various radii.
Write code to calculate the amount required to repay this loan by performing the following steps:
1. Create a variable named pi to store the value 3.14159.
2. Create three variables named r1, r2, and r3 to store the values 4.6, 7.2 and 9.7. Each of these values is
intended to represent the radius of a sphere.
3. Use the variables created in Parts 1 and 2 to calculate the volumes of the spheres with the given radii. Store the
results in variables named v1, v2, and v3. Do not round the values stored in these variables.
4. Print the results using three message in format shown below, with the xxxx symbols replaced with the
appropriate values. Round the displayed values for the volumes to 3 decimal places.
The volume of a sphere with radius xxxx is equal to xxxx.
2