Processing is essentially pseudocode telling what you are going to do. Once it is defined, you test with data.
I could have set this up with var infront of the variables I define. I prefer tht style. Here I entered a number less than 5000 at the prompt, so the if is not executed and the
I put in 7890 so it is greater than 5000 and the if executes by multiplying amt 1 by 10 and assigning the result to ans.
Hou sekeep ing I want to prompt the user each time I do the while loop so the prompt has to be Proce inside the loop. ssing Wra pup
Only one entry was greater than 5000 so the answer is only printed once and ans was only added to tot once. Note that ct which controls how
Here I put in 10000 each time so amt 1 is always greater than 5000 so I execute the if which calculates ans, adds ans to tot and writes out ans.
It would be better not to put var in front of amt 1 inside the loop, but to put it outside with the other variables in the initialize or housekeeping part of the program.
I could have put var in front of each of these because they are all memory variables.
When ct started at 1 in other examples, I did the loop 4 times. Now ct is starting at 0 so I do it 5 times.
Initialize or housekeeping I want to get the random number before going into the loop so I do it in initialize or house- The loop does the processing. There is no wrapup in this program.