Hello,
I understand that you are trying to figure out how to increase the wage every year and rent every five years. Refer to code below to increase rent and wage.
CODE:
clear;
clc
monthlyWageAfterTaxes = 2700;
numberOfYears=30;
rent=800;
utilities=300;
insurance=200
auto=250
food_misc=325;
numberOfMonths=360;
for j=1:numberOfMonths
monthlySavings=(monthlyWageAfterTaxes-rent-utilities-insurance-auto-food_misc)
yearlySavings=monthlySavings*12
totalSavings=yearlySavings*30
disp(j)
if ~mod(j/12,1) == 1
monthlyWageAfterTaxes = 1.2*monthlyWageAfterTaxes;
disp("wage increased");
end
if ~mod(j/60,1) == 1
rent = rent + 200;
disp("rent increased")
end
end
Hope this helps!.