What am I doing now?
Explaining if else if statement to a designer 
Friday, December 21, 2007, 02:23 PM - Scripts
Posted by Administrator
who likes to shop - she couldn't wrap her head around, so I explained it as so:


if (the store has blue shoes)
buy the blue shoes
else if (the store has red shoes)
buy the red shoes
else if (the store has pink shoes)
buy the pink shoes
else
go to another store, I must have blue, red or pink shoes


With:
since you only want to buy blue, red or pink shoes and your preference is in that order, blue the most, then red and then pink, that is how that would look in an if else if statement

if the store has pink and red shoes, the code would have you buy the red shoes. Blue and red, you end up with blue, all three, still blue. The only way to have pink is if blue and red shoes aren't at the store. And, if the store doesn't have any of the colors, you go somewhere else
------------------------------
How's that for making it relative to the listener!

add comment ( 3 views )   |  0 trackbacks   |  permalink   |   ( 3 / 330 )

<<First <Back | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Next> Last>>