QUESTION IMAGE
Question
complete the program as follows:
- read sound_power and distance_traveled from input as floats, respectively.
- compute sound_intensity using the formula $sound_intensity = \frac{sound_power}{(4.0 * \pi * distance_traveled^2)}$
- output \sound wave intensity is \ followed by the value of sound_intensity to three digits after the decimal point.
ex: if the input is:
10.0
9.0
then the output is:
sound wave intensity is 0.010
note:
- use math.pi for $\pi$.
- $distance_traveled^2$ can be computed using *.
import math
Step1: Read input values
Read sound_power and distance_traveled as floats:
sound_power = float(input())
distance_traveled = float(input())
Step2: Calculate sound intensity
Use the given formula with math.pi:
sound_intensity = sound_power / (4.0 * math.pi * distance_traveled * distance_traveled)
Step3: Format and print output
Print the result rounded to 3 decimal places:
print(f"Sound wave intensity is {sound_intensity:.3f}")Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
import math
sound_power = float(input())
distance_traveled = float(input())
sound_intensity = sound_power / (4.0 * math.pi * distance_traveled * distance_traveled)
print(f"Sound wave intensity is {sound_intensity:.3f}")