write a program to find the volume of a sphere with radius 8.5 CM
Answers
Volume of sphere - Python
As we are not given/mentioned in the Question only by which programming language we write the required program, therefore here we use python program to calculate the volume of sphere.
Let us take a look at what we need to do in this program.
First we will import the math package. We'll import the Math module by simply typing There are various other modules as well, another common one being statistics, that is widely used for statistics purposes.
Since in the question we are provided with the radius of sphere. The radius of sphere is 8.5cm.
As we know that, the formula of the volume of sphere.
Volume of the sphere is : V = 4/3 * π * r³
[Here, V is the volume of sphere, the value of π is 22/7 but here we will use math.pi for π and r is the radius of sphere]
But here radius is in cube, so here we can use function to raise cube. You can also use Exponentiation operator or by simply multiply radius value by three times.
Finally, by simply using this formula we can calculate the volume of sphere. And we will print the volume of sphere by using with "{:.2f}", it will print only 2 decimal places.
The Python Program
Here's the Python Program to calculate the the volume of sphere.
# Python Program to calculate the volume of sphere
# import math package/module to use pi value
import math
# Given that, radius = 8.5cm
radius = 8.5
# Volume of sphere = 4/3 * π * r³
volume = (4/3)*math.pi*pow(radius,3)
# Print out the volume of sphere
print("The volume of sphere is", "{:.2f}".format(volume), "cubic units.")
We can shorten the above program even more. Let's shorten the program.
# Python Program to calculate the volume of sphere
# import math package/module to use pi value
import math
# Volume of sphere = 4/3 * π * r³
# Given that, radius = 8.5cm
# Now print out the volume of sphere
print("The volume of sphere is", "{:.2f}".format((4/3)*math.pi*pow(8.5,3)), "cubic units.")
[Hashtag (#) is only a single line comment in Python, It's not printed in the program, I have used them here for understanding the program step-by-step. If you want then you can remove those comments from the program.]
I'll be pasting here the same program by removing all the comments.
import math
print("The volume of sphere is", "{:.2f}".format((4/3)*math.pi*pow(8.5,3)), "cubic units.")
Python: Surface volume and area of a sphere
A sphere is a perfectly round geometrical object in three-dimensional space that is the surface of a completely round ball.
In three dimensions, the volume inside a sphere is derived to be V = 4/3*π*r3 where r is the radius of the sphere
The area of a sphere is A = 4*π*r2
REFER THE ATTACHMENT FOR SAMPLE FLOWCHART .
★KNOW MORE ON BRAINLY★
https://brainly.in/question/43542340?