import java.io.IOException;
public class Gravity1
{
public static void main(String[] args) throws IOException
{
String[] names = {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"};
double[] radii = {2439.7, 6051.9, 6378, 3402.5, 71492, 60270, 25562, 24774, 1195};
double[] masses = {3.3022 * Math.pow(10,23), 4.8685 * Math.pow(10,24), 5.9736 * Math.pow(10,24), 6.4185 * Math.pow(10,23), 1.8986 * Math.pow(10,27), 5.6846 * Math.pow(10,26), 8.6810 * Math.pow(10,25), 1.0243 * Math.pow(10,26), 1.312 * Math.pow(10,22)};
// alternate
//double [] mass = {3.30E23, 4.87E24, 5.97E24, 6.42E23, 1.90E27, 5.68E26, 8.68E25, 1.02E26, 1.27E22};
double[] gravities = calcGravity(radii, masses);
printResults(names, radii, masses, gravities);
printToFile(gravities);
}
//The return type for printResults is void because you are not returning anything.
//The return type for calcGravity is an array of doubles:
public static double [] calcGravity (double[] arrayDoubles){
double earthGravity = 6.67 * Math.pow(10, -17) * massOfPlanet/ Math.pow(radiusOfPlanet, 2); //The general formula to find gravity:
}
//where massOfPlanet and radiusOfPlanet are replaced in the above formula by array values.
}