title: Determining the real roots of a polynomial within a specific range
body: <p>I am a  beginner in coding especially in java and I have tried plenty of times figuring how to find the real roots of a polynomial within a given range. The program is supposed to find all the real roots of the given polynomial the user provided. For example, the program should run as follows: 
  Enter the degree: 3
  Enter 4 coefficients: -6 11 -6 1
  Enter the left and right endpoints: -10 10
  Root found at: 1.00000 Root found at: 2.00000 Root found at: 3.00000.
  Attached below is the format of my program.</p>
  
  <pre><code>    import java.util.Scanner;
      class Roots{
      public static void main(String[] args){
              Scanner sc=new Scanner(System.in);
              double resolution=0.01;
              double tolerance=0.0000001;
              double threshold=0.001;
              double roots;
              System.out.print("Enter the degree: ");
              int degree =sc.nextInt();
              System.out.print("Enter "+(degree+1)+" coefficients: ");
              double[] C=new double[degree+1];
              for(int i=0; i&lt;C.length;i++){
                      C[i]=sc.nextDouble();
              }
              System.out.print("Enter the left and right endpoints: ");
              double a=sc.nextInt();
              double b=sc.nextInt();
              if(poly(C,a)*poly(C,b)&lt;0){
                      roots=findRoot(C,a,b,tolerance);
              }
      }
      }
      static double poly(double[] C, double x){
              int n=C.length-1;
              int K;
              double sum=0.0;
              for(int i=0;i&lt;n;i++){
                      sum+=C[i]*(Math.pow((x-i),n));
              }
              return sum;
      }
      static double[] diff(double[] C){
              int n=C.length-1;
              int K;
              double[]D=new double[n];
              for(int i=0;i&lt;n;i++){
                      D[i]=C[i]*(n-1);
              }
              return D;
      }
      static double findRoot(double[] C, double a, double b, double tolerance){
              //loops here
      }
  </code></pre>
  
  <p>}</p>