I am experiencing a problem with this code:
public class gravityv1 { public static double[] calculategravity(double[] mass, int[] diameter) { double[
You need a try-catch block in your main method around all methods that throw an IOException:
main
IOException
try { printFile(gravity); } catch (IOException ex) { // handle exception here }
Include all methods that have throws IOException after the signature.
throws IOException