Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python. I did the function like this, but it cannot run correctly. def main (): m1 = float(input('enter mass1:')) m2 = float(input('enter mass2:')) d
Using Python.
I did the function like this, but it cannot run correctly.
def main (): m1 = float(input('enter mass1:')) m2 = float(input('enter mass2:')) d =float(input('enter the distance between m1 and m2:')) k =float(6.67* 10**(-8)) F = (k*m1*m2)/d**2 print(F) main()
According to Newton's universal law of gravitation, the force F between two bodies with masses M1 and M2 is computed as where d is the distance between the two bodies and k is a positive real number called the gravitational constant. The gravitational constant k is approximately equal to 6.67 10-8 dyn-cm2 / g2 Write a program that 1. Reads from the keyboard the mass for the the two bodies in grams g, the distance between the two bodies in centimeters cm, and then 2. Computes the force F. Here is an interesting fact: the force between the Earth and the moon is 1.984 1025 dyn, the mass of the earth is 5.983 x 1027 g, the mass of the moon is 7.347 x 1025 g, and the distance between the two is 3.844 x 1010 crm. This may help you determine if your program is working correctlyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started