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

Monday, 26 August 2013

Update Environment Variables - algorithms

1. The problem is that the environment variables need to be calculated to be updated.
2. The inputs are X, Y, R and T.
3. The outputs are X and Y.
4. The processing tasks are X incremented by R and Y incremented by T.
If X > 5000 then Y decremented by 1000.
If Y < 0, Y and X are set to 0.
5. Pseudocode

Update environment variables
Prompt user for X, Y, R and T

Get X, Y, R and T
X = X + R
Y = Y + T

If X > 5000
Y = Y - 1000

If Y < 0
Y = 0
X = 0

End


Tuesday, 20 August 2013

Object modelling

TV remote
Attributes:  Buttons, Batteries, Brand, Colour
Behaviours:  Button press

USB
Attributes:  Brand, Colour, USB slot, Data capacity
Behaviours:  USB port insert

Phone
Attributes:  Numpad, Battery, Sim Card, SD card, Mic, Touch screen
Behaviours:  Makes calls, recieves calls, touch sensitive