Cody

# Problem 44860. Sum of a geometric series

Solution 1878540

Submitted on 19 Jul 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
a = 1; r= 0.1; n=10; y_correct = a*(1 - r^n)/(1-r); assert(isequal(your_fcn_name(a,r,n),y_correct))

Undefined function or variable 'x'. Error in your_fcn_name (line 2) y = x; Error in Test1 (line 5) assert(isequal(your_fcn_name(a,r,n),y_correct))

2   Fail
a = 0.2; r= 0.2; n=5; y_correct = a*(1 - r^n)/(1-r); assert(isequal(your_fcn_name(a,r,n),y_correct))

Undefined function or variable 'x'. Error in your_fcn_name (line 2) y = x; Error in Test2 (line 5) assert(isequal(your_fcn_name(a,r,n),y_correct))

3   Fail
a = 0.4; r= 0.3; n=7; y_correct = a*(1 - r^n)/(1-r); assert(isequal(your_fcn_name(a,r,n),y_correct))

Undefined function or variable 'x'. Error in your_fcn_name (line 2) y = x; Error in Test3 (line 5) assert(isequal(your_fcn_name(a,r,n),y_correct))