0

The code that i need has a starting value of 5. From this starting value on a list of numbers is added consecutively like this

list {-0.1,-0,3,-0.1,0.1,-0.1}

output should look like this {4.9,4.6,4.5,4.6,4.5}

It's pretty much like a mechanism of a bank account where you add or withdraw money and your actual values after each step should be shown in the outputted list. Furthermore it should be limited between two values like min=2 and max=10.

I tried anything i can imagine of by looking at the documentation but i'm lacking the experience with mathematica to get anywhere near any possible solution. In fact, the main problem is adding up the previous number with the new value of the list element to create a new value (and then consecutively ongoing loop thill the list ends).

Can somebody suggest me a solution?

0 Answers0