title: Incompatible types: possible lossy conversion from double to int
body: <p>Help? I don't know why I am getting this error. I am getting at in line 39:</p>
  
  <pre><code>term[1] = differentiate(Coeff[1], exponent[1]);
  </code></pre>
  
  <p>How can I fix this issue?</p>
  
  <p>Full code listing:</p>
  
  <pre><code>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 &gt; 6) {
              if (numTerms &gt; 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 &lt; 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;
      }
  }
  </code></pre>