public class GravityV1
{
// Calculate surface gravity
public static double surfaceGrav( double []massKilo, double[] diameter)
{ double gravConstant = 6.67E-11;
double []surfaceGravi= new double[9];
for(int count = 0; count < surfaceGravi.length;count++)
{
surfaceGravi[count] = ((gravConstant * massKilo[count]) / (Math.pow(diameter[count]/2,2)));
}
return surfaceGravi;
}
public static void main(String[]args)
{
String [] planetName = {"Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune","Pluto"};
double [] massKilo = {3.30E23,4.869E24,5.972E24,6.4219E23,1.900E27,5.68E26,8.683E25,1.0247E26,1.27E22};
double [] diameter = {4880,12103.6,12756.3,6794,142984,120536,51118,49532,2274};
}
}