Textbook Notes (363,452)
ITM 200 (25)
Chapter 5

3 Pages
99 Views

School
Ryerson University
Department
Information Technology Management
Course
ITM 200
Professor
Semester
Summer

Description
Khushi Sharma Tuesday May 15 , 2012 Chapter 5 The ‘If-Else’ Statement Boolean Expressions: -Boolean expression is one which evaluates to a Boolean value -Examples: Expression Meaning X > Y is X greater than Y? X < Y is X less than Y? X >= Y is X greater than or equal to Y? X <= Y is X less than or equal to Y? X = Y is X equal to Y? X! = Y is X not equal to Y? The IF Statement -the IF statement decides whether a section of codes executes or not -the IF statement used a Boolean to decide whether the next statement of blocks of statements executes Boolean Value -there are only two possible values for Boolean expressions:  True  False Rational Operators -you can construct simple Boolean expressions from the relational operators which are below -Example: Rational Operators Meaning > Less than < Greater than <= less than or equal >= greater than or equal == Equals != not equals The IF-ELSE Statement – Details: -syntax of the java if-else statement is as below: If () else -if and else are Java reserved words, which give the if-else statement its structure and tell the complier that this is an if-else statement -the is a Boolean expression -the and are Java statements Khushi Sharma Tuesday May 15 , 2012 IF – ELSE Matching: -curly braces use is not required if there is only one statement to be conditionally executed -sometimes curly braces can help make the program more readable -indentation makes it much easier to match up else statements with their corresponding if statement Nested IF – ELSE Stat
More Less

Related notes for ITM 200

OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.