Thursday 26 September 2013

For Loops

1.  The 3 things that need to be set when priming a For Loop are the initialization, termination and the increment.
2.  The amount of times the example will print the world hello is 10.

Tuesday 3 September 2013

Update environment variables 2 - implementation


Update environment variables 2 - algorithm

1.  The problem is that the environment variables need to be calculated.
2.  The inputs of this algorithm are X, Y and R.
3.  The outputs of this algorithm are X and Y.
4.  The processing tasks are Y incremented by R, If Y > 100 then X decremented by 10 and If Y > 200 then X and Y equal 0.
5.  Pseudocode

Update environment variables 2
Prompt user for X, Y, R

Get X, Y, R

Y = Y + R
If Y > 100
X = X - 10
If Y > 200
X = 0
Y = 0

End