July 2011
Intermediate to advanced
400 pages
8h 46m
English

Computer programs, like life itself, are full of difficult decisions waiting to be made. Things like “If I stay in bed, I will get more sleep, else I will have to go to work; if I go to work, I will earn some money, else I will lose my job,” and so on. You’ve already performed a number of if tests in previous programs. To take a simple example, this is from the Tax calculator in Chapter 1:
if (subtotal < 0.0) then subtotal = 0.0 end
In this program, the user was prompted to enter a value, subtotal, that was then used in order to calculate the tax due on it. If the user, in a fit of madness, enters a value less than ...
Read now
Unlock full access