I need help multiplying the same array with it self (squaring it). I tried copying it and make a new array but I still get the error of incompatible types. The error is higlighted over radius1 stating incompatible types.
public static double[] part1(double[] z, double[] radius,double [] radius1)
{
for(int index=0; index <10; index++)
{
z= radius[index]*radius1[index];
}
// The formula to calculate gravity is:
// 6.67E-11 times the massOfPlanet divided by the radius of the planet squared
return z;
}
public static void main(String[] args)throws IOException
{
double[] radius = {2439.7, 6051.9, 6378, 3402.5, 71492, 60270, 25562, 24774, 1195};
double[] radius1 = {2439.7, 6051.9, 6378, 3402.5, 71492, 60270, 25562, 24774, 1195};
double z[]= new double [9];
}