Question: Solve the following code in python. Thank you 1. def divide_and_raise(numerator: int, denominator: int, power: int) -> float: TODO: write the function purpose, parameters,

Solve the following code in python. Thank you

1. def divide_and_raise(numerator: int, denominator: int, power: int) -> float:

"""

TODO: write the function purpose, parameters, and return value description here

""" return (numerator / denominator) ** power

2. def get_pi() -> float:

"""

TODO: write the function purpose, parameters, and return value description here

""" return 3.14159

3. def calculate_sphere_volume_m3(radius_m: float) -> float:

"""

TODO: write the function purpose, parameters, and return value description here

"""

return (4 / 3) * get_pi() * (radius_m ** 3)

4. def get_volume_diff_spheres(radius_sphere_a: float, radius_sphere_b: float) ->

float:

"""

get_volume_diff_spheres(radius_sphere_a, radius_sphere_b) calculates

the difference between two different radius spheres in cubic meters.

example: get_volume_diff_spheres(1.0, 1.0) -> 0.0

example: get_volume_diff_spheres(2.0, 1.0) -> 29.3215

TODO: fill in this function definition, making sure to call

5. calculate_sphere_volume_m3()

for each sphere in order to return the difference.

:param: radius_sphere_a: the larger sphere's radius in meters

:param: radius_sphere_b: the smaller sphere's radius in meters

:returns: the difference between the two sphere volumes

"""

pass #

TODO: delete and replace this line with your own code

def get_percent_smaller_spheres(radius_sphere_a: float, radius_sphere_b: float) ->

float:

"""

get_percent_smaller_spheres(radius_sphere_a, radius_sphere_b) calculates

what percentage the smaller sphere's volume is of the larger sphere's volume

example: get_percent_smaller_spheres(1.0, 1.0) -> 100.0

example: get_percent_smaller_spheres(2.0, 1.0) -> 12.5

TODO: fill in this function definition, making sure to call

6.calculate_sphere_volume_m3()

for each sphere so you can use it to calculate the percentage.

:param: radius_sphere_a: the larger sphere's radius in meters

:param: radius_sphere_b: the smaller sphere's radius in meters

:returns: the difference between the two sphere volumes in terms of percentage

of the larger sphere's volume

"""

pass #

TODO: delete and replace this line with your own code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!