m2 separated by a distance d is given by:F = Gm1m2d 2where G is the universal gravitational constant:G = 6.673 × 10−8 cm3g × sec2Write a function definition that takes arguments for the masses of two bod-ies and the distance between them and that returns the gravitational force. Since you will use the preceding formula, the gravitational force will be in dynes. One dyne equalsg × cmsec2You should use a globally defined constant for the universal gravitational constant. Embed your function definition in a complete program that computes the gravitational force between two objects given suitable inputs. Your program should allow the user to repeat this calculation as often as the user wishes. C++
m2 separated by a distance d is given by:
F = Gm1m2
d 2
where G is the universal gravitational constant:
G = 6.673 × 10−8 cm3
g × sec2
Write a function definition that takes arguments for the masses of two bod-
ies and the distance between them and that returns the gravitational force.
Since you will use the preceding formula, the gravitational force will be in
dynes. One dyne equals
g × cm
sec2
You should use a globally defined constant for the universal gravitational
constant. Embed your function definition in a complete
computes the gravitational force between two objects given suitable inputs.
Your program should allow the user to repeat this calculation as often as
the user wishes.
C++
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images