Cody

Problem 44142. Percentage profit:5: Cumulative Interest

Solution 1175886

Submitted on 30 Apr 2017 by yurenchu
• Size: 26
• This is the leading solution.
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
x = 100; r=12.683; n=1; y_correct = 1; assert(isequal(your_fcn_name(r,x,n),y_correct))

ans = 1

2   Pass
x = 100; r=12.683; n=12; y_correct = 12.683; assert(isequal(your_fcn_name(r,x,n),y_correct))

ans = 12.6830

3   Pass
x = 100; r=12.683; n=24; y_correct = 26.975; assert(isequal(your_fcn_name(r,x,n),y_correct))

ans = 26.9750

4   Pass
x = 100; r=12.683; n=30; y_correct = 34.786; assert(isequal(your_fcn_name(r,x,n),y_correct))

ans = 34.7860

5   Pass
x = 100; r=7; n=5; y_correct = 2.859; assert(isequal(your_fcn_name(r,x,n),y_correct)) x = 1000; r=12.683; n=1; y_correct = 10; assert(isequal(your_fcn_name(r,x,n),y_correct))

ans = 2.8590 ans = 10

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!