Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 202921

Submitted on 11 Feb 2013

Incorrect

52Size
Leading solution size is 36.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
financial.startingSalary =   50000;
financial.investRate     =       0.1;
financial.returnRate     =       0.1;
financial.raiseRate      =       0.05;
financial.goal           = 1000000;
y_correct = 29;
assert(isequal(calculateRetirementYear(financial),y_correct))
Error: Assertion failed.
2
Fail
 
%%
financial.startingSalary =   60000;
financial.investRate     =       0.12;
financial.returnRate     =       0.1;
financial.raiseRate      =       0.05;
financial.goal           = 1000000;
y_correct = 26;
assert(isequal(calculateRetirementYear(financial),y_correct))
Error: Assertion failed.
3
Fail
 
%%
financial.startingSalary =   60000;
financial.investRate     =       0.12;
financial.returnRate     =       0.1;
financial.raiseRate      =       0.05;
financial.goal           = 2000000;
y_correct = 32;
assert(isequal(calculateRetirementYear(financial),y_correct))
Error: Assertion failed.
4
Fail
 
%%
financial.startingSalary =   60000;
financial.investRate     =       0.12;
financial.returnRate     =       0.1;
financial.raiseRate      =       0.08;
financial.goal           = 2000000;
y_correct = 29;
assert(isequal(calculateRetirementYear(financial),y_correct))
Error: Assertion failed.