function savingsBalance = CalculateBalance(numberYears, savingsBalance)
% numberYears: Number of years that interest is applied to savings
% savingsBalance: Initial savings in dollars
interestRate = 0.025; % 2.5 percent annual interest rate
% Complete the for loop to iterate from 1 to numberYears (inclusive)
for year = 1:numberYears
savingsBalance = savingsBalance + (savingsBalance * interestRate);
end
end
ZnVuY3Rpb24gc2F2aW5nc0JhbGFuY2UgPSBDYWxjdWxhdGVCYWxhbmNlKG51bWJlclllYXJzLCBzYXZpbmdzQmFsYW5jZSkKJSBudW1iZXJZZWFyczogTnVtYmVyIG9mIHllYXJzIHRoYXQgaW50ZXJlc3QgaXMgYXBwbGllZCB0byBzYXZpbmdzCiUgc2F2aW5nc0JhbGFuY2U6IEluaXRpYWwgc2F2aW5ncyBpbiBkb2xsYXJzCgppbnRlcmVzdFJhdGUgPSAwLjAyNTsgJSAyLjUgcGVyY2VudCBhbm51YWwgaW50ZXJlc3QgcmF0ZQoKJSBDb21wbGV0ZSB0aGUgZm9yIGxvb3AgdG8gaXRlcmF0ZSBmcm9tIDEgdG8gbnVtYmVyWWVhcnMgKGluY2x1c2l2ZSkKZm9yIHllYXIgPSAxOm51bWJlclllYXJzCiAgICBzYXZpbmdzQmFsYW5jZSA9IHNhdmluZ3NCYWxhbmNlICsgKHNhdmluZ3NCYWxhbmNlICogaW50ZXJlc3RSYXRlKTsKZW5kCgplbmQK