public static void main(String[] args)throws IOException 
    {        
        double finalAnswer=0;
        double finalcurvePoints=0;
        double finalPeriod=0;
        double finalPercDif=0;
        
        for(int i = 2;i<=15;i++){
            for(int j=2;j<=10;j++){
                for(int k=2;k<=10;k++){
                    int curvePoints=i;
                    int period=j;
                    double difPercent=k;
                    double answer=OptimiseParameters(curvePoints,period,difPercent);
                    if(finalAnswer<answer){
                        finalAnswer=answer;
                        finalcurvePoints=curvePoints;
                        finalPeriod=period;
                        finalPercDif=difPercent;
                    }
                }
            }
        }
        System.out.println("The best parameters are : ");
        System.out.println("period : "+finalPeriod);
        System.out.println("curvePoints : "+finalcurvePoints);
        System.out.println("PercentDifferenceNeeded : "+finalPercDif);
        System.out.println("The best effective annual return for these parameters is : "+finalAnswer);
    }