function z = bankbalance(c,nmonths)
z = 0; %! initial balance
for m = 1:nmonths
    if z >= 0
        z = 1.002.*z + c; %! positive balance
    else
        z = 1.010.*z + c; %! negative balance
    end
end
