src/com/michaelho/DivideAndConquer/DC3.java
/**
     * The naive method to calculate the sum of geometric series.
     *
     * @param a The first term of the series.
     * @param r The common ratio.
     * @param n The number of terms.
     *
     * @return The result of the sum of the series.
     * */
The naive method to calculate the sum of geometric series.
@param a The first term of the series.
@param r The common ratio.
@param n The number of terms.

@return The result of the sum of the series.
The naive method to calculate the sum of geometric series . @param a The first term of the series . @param r The common ratio . @param n The number of terms . @return The result of the sum of the series .
float sumOfGS(float a, float r, int n) {
        float sum = 0;
        for (int i = 0; i < n; i++) {
            sum = sum + a;
            a = a * r;
        }
        return sum;
    }
float sumOfGS ( float a , float r , int n ) { float sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum = sum + a ; a = a * r ; } return sum ; }
The naive method to calculate the sum of geometric series.
The naive method to calculate the sum of geometric series .