Assignment 5 ITSE 1429 -
07-25-2014, 11:43 AM
Within this assignment we are in the beginning stages of giving logic to objects within our world. This particular assignment took some deep thinking in that it was necessary to hit upon a certain value to achieve a certain result. In this case it was an age. Any value over or under the value of 21 then the user was denied their goal. Only with defining the value of 21 was the user able to accomplish their goal. To accomplish this I was to use the if/else statement within a method. This lead me to an interesting conclusion. There would be several ways to accomplish this type of behavior. I could have defined an if portion as equal to 21 and then the else portion to be greater than or less than 21 to call other methods. Instead what I ultimately did was to define the if portion as being greater than 21 then add yet another if/else statement. From there I once again defined the if portion as being less than 21 and , interestingly enough, the only value left from these two statements would be the correct value of 21.
|