calculations with multiple variables


Is it possible to determine the value of one variable by performing some calculation of other variables? The following is a very simple example, just to illustrate the kind of thing I'd like to do. (It's too simple to include in a course, but if I can understand how to use variables to do this one, I'll know how to do more complex examples, I hope!...).

Say I had a course on planning household finances. To calculate how much the learner needs to save each month they could enter their target savings amount in one variable (called, say, SavingTarget) and the number of months to reach that goal in another variable (NumberOfMonths). I can then calculate the amount they need to save each month, and display the result in a variable called SavingPerMonth. To do this I would set SavingPerMonth to be SavingTarget divided by NumberOfMonths.

Appreciate responses.

Thanks, Diane.

3 Replies