Answer to Question #100206 in C++ for Grace

Question #100206
Compute the acceleration of gravity for a given distance from the earth's center, distCenter, assigning the result to accelGravity. The expression for the acceleration of gravity is: (G * M) / (d2), where G is the gravitational constant 6.673 x 10-11, M is the mass of the earth 5.98 x 1024 (in kg) and d is the distance in meters from the earth's center (stored in variable distCenter).
1
Expert's answer
2019-12-10T13:23:53-0500
#include <iostream>

using namespace std;

int main()
{
    const double G = 6.673e-11;
    const double M = 5.98e24;
    double distCenter, accelGravity;
    cin >> distCenter;
    accelGravity = G * M / (distCenter * distCenter);
	
	cout<<accelGravity;

    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS