Question: Write a program in Java for the following Artemis I should be launching soon. The mission of the program is to create a base on
Write a program in Java for the following
Artemis I should be launching soon. The mission of the program is to create a base on the moon for future voyages to Mars. The will experience three (3) different gravities on their journey. The table below contains the planets mass, diameter, and gravity:
| Planet | Mass(kg) | Diameter(m) | Gravity(g) | |
| Earth | 5,973,600,000,000,000,000,000,000 | 12,756,000 | 9.795 | |
| Moon | 73,460,000,000,000,000,000,000 | 3,475,000 | 1.623 | |
| Mars |
| 6,792,000 | 3.711 |
Develop a program to calculate the gravity based on the following formula:

where g is gravity, G the gravitational constant, M mass and R the planets radius. The Gravitational constants value is 0.0000000000667.
Your program needs to be written so the user inputs the planets diameter per the table above.
g=R2GM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
