Cody

Solution 2667530

Submitted on 8 Jul 2020 at 13:40 by Ramesh Kumar V
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   Pass
n = 1; y_ok = 1.12; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.120000000000000

2   Pass
n = 2; y_ok = 1.1236; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.123600000000000

3   Pass
n = 12; y_ok = 1.126825030132; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.126825030131970

4   Pass
n = 52; y_ok = 1.127340987167; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.127340987166906

5   Pass
n = 365; y_ok = 1.127474615638; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.127474615638400

6   Pass
n = 31536000; y_ok = 1.1274968514306000; assert(abs(compound(n)-y_ok)<1e-9);

y = 1.127496852242145