0

I have this problem, been stuck for hours now.

This method is getting out of bounds exception when i try to print it. Im using the input variables from the method posted below this. Thanks!

public static double [] calcLine(double x, double k, double m){
    double tx = 1;
    double[] list = new double[(int) x]; 
    for(double i =1; i <= 5; i++){

        list[(int) i]+= calcPoint(tx,k,m);
        tx++;
    }

        return list;

}

This is the calcPoint method i use;

public static double calcPoint(double x,double k, double m){

    double calcPointInput = k*x+m;
    return calcPointInput;
}

Cheers L

0 Answers0