Cody

# Problem 44932. Compound Interest Rate Calculation With Yearly Deposition Into A Bank Account

Solution 1867324

Submitted on 7 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
principle_amount = 1000; yearly_deposition = 1200; number_years = 50; interest_rate = 0.05; y_correct = 2.752458743867467e+05; assert(isequal(compound_interest(principle_amount, yearly_deposition, number_years, interest_rate),y_correct))

Undefined function or variable 'n'. Error in compound_interest (line 2) for i = 1:n Error in Test1 (line 9) assert(isequal(compound_interest(principle_amount, yearly_deposition, number_years, interest_rate),y_correct))

2   Fail
principle_amount = 5000; yearly_deposition = 5500; number_years = 10; interest_rate = 0.02; y_correct = 6.752290690850318e+04; assert(isequal(compound_interest(principle_amount, yearly_deposition, number_years, interest_rate),y_correct))

Undefined function or variable 'n'. Error in compound_interest (line 2) for i = 1:n Error in Test2 (line 9) assert(isequal(compound_interest(principle_amount, yearly_deposition, number_years, interest_rate),y_correct))

### Community Treasure Hunt

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

Start Hunting!