Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose we have three rubber balls of different sizes and we need to know the volume of each one. You may recall that the volume

image text in transcribed
Suppose we have three rubber balls of different sizes and we need to know the volume of each one. You may recall that the volume of a sphere is given by the equation where V is the volume, r is the radius, and is the ratio of the circumference of a circle to its diameter. In fact, it is an irrational number, but for our purposes, the approximation 3.14...) will be close enough. 1. Create a new Python file. Add the usual comment header. Save it as volumeofsphere.py. For the following steps, write the code into this file. Write an assignment statement for a variable called "pi", using the appropriate Python expression so that its value is the approximation to described above. 2. The radii of the three balls are 1.5, 3.0, and 5.2 cm, respectively. Assign these three values to variable called "radius_1", "radius_2", and "radius_3". 3. Write assignment statements for the variables "volume 1","volume 2", and "volume 3", so that each variable stores the volume of the corresponding ball. The expression giving the value of each variable should refer to the corresponding radius variables "radius_1", "radius_2", and "radius_3", as well as the pi variable that you defined previously. 4. Write print statements so that when your program is run, it will display the volumes of the three balls, formatted as follows: volume of ball 1 in cm: volume of ball 2 in cm: volume of ball 3 in cm: where is replaced by the respective volume. Your print statements may not contain any numbers at all, but should instead refer to the volume variables you defined above. 5. Run your program in Python to make sure that it produces the expected result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

Students also viewed these Databases questions

Question

do you answer assignment questions?

Answered: 1 week ago