This is an extended post for selection. The first example is the one we always use in our daily lives, that is to calculate the BMI of a person.
Click here for coding.
It will display your current BMI based on your weight and height that you have entered and it also tell you whether you're underweight, normal weight or overweight.
The next example will show you how to use Boolean expressions along with selection statement.
This program is to determine whether the year that user input is a leap year or not.
Click here for coding.
Monday, March 7, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment