Tuesday, January 13, 2015

ch 1 post

we learned about conditional branching. in this chaperter we learned about looping and boolean test. A simple boolean test is < less than, > greater than, == equality. loops can be created by using while and do-while's. the line will keep looping untill condision is completed. To practice what we learned we made the 99 bottles of beer activtiy. This tested out our boolean test we had to create a looping tester to make sure it would go to 1 and then stop and go down by 1 each time.

 beerNum = beerNum - 1

this makes the number go down by one.

(beerNum > 0)


this makes sure that the beer count cant go below 0.

beerNum == 99;

this sets the beer count to 99


No comments:

Post a Comment