Help? I don't know why I am getting this error. I am getting at in line 39:
term[1] = differentiate(Coeff[1], exponent[1]);
How can I fix this issue?
Full code listing:
public class Calcprog {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int numTerms = 7;
        double[] Coeff = new double[6];
        double[] exponent = new double[6];
        String[] term = new String[6];
        System.out.println("Enter the number of terms in your polynomial:");
        numTerms = input.nextInt();
        while (numTerms > 6) {
            if (numTerms > 6) {
                System.out.println("Please limit the number of terms to six.");
                System.out.println("Enter the number of terms in your polynomial:");
                numTerms = input.nextInt();
            }
        }
        for (int i = 1; i < numTerms + 1; i++) {
            System.out.println("Please enter the coefficient of term #" + i + " in decimal form:");
            Coeff[i] = input.nextDouble();
            System.out.println("Please enter the exponent of term #" + i + " in decimal form:");
            exponent[i] = input.nextDouble();
        }
        term[1] = differentiate(Coeff[1], exponent[1]);
    }
    public String differentiate(int co, int exp) {
        double newco, newexp;
        String derivative;
        newexp = exp - 1;
        newco = co * exp;
        derivative = Double.toString(newco) + "x" + Double.toString(newexp);
        return derivative;
    }
}