Question: C++ homework; This is a two-part problem, please leave comments under // 1) The gravitational attractive force F between two bodies with masses m1 and

C++ homework;

This is a two-part problem, please leave comments under //

C++ homework; This is a two-part problem, please leave comments under //

1) The gravitational attractive force F between two bodies with masses m1 and m2 separated by a center-to-center distance r is given by the following formula Gm1m2 m.x Where G is the universal gravitational constant G-6.67384 x 10-11 Write a function that takes arguments for the masses of the two bodies and the distance between them and returns the gravitational force between them. You should use a locally defined constant variable G for the universal gravitational constant G. Test your function to find the gravitational force with the earth moon data below xample data Mearth 5.97219 x 104 kg Mmoon 7.34767x 102 kg Earth-moon distance (average) 363104 x 103 m F2.22 x 1020 N Use the earth moon data to verify your function 2"d part: Now improve your program by embedding your function in a complete program that asks the user to enter input for the masses and separation distance, and then calls your function to compute this. Finally, your program should allow the user to repeat this calculation as many times as they wish

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Lets tackle this C problem step by step Step 1 Write the Function First well write a function to calculate the gravitational force This func... View full answer

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!