Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1/18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical.

Similar presentations


Presentation on theme: "March 2005 1/18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical."— Presentation transcript:

1 March 2005 1/18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical Operations Comparing String ObjectsComparing String Objects

2 March 2005 2/18R. Smith - University of St Thomas - Minnesota More IF Features Nested IFNested IF –Use curly braces to control the flow –Example: Loan money if 2 years on job and $25k salary “Boolean” Logical Operations“Boolean” Logical Operations –Boolean variables –! And && and || –Loan example revisited Order of Precedence p. 138Order of Precedence p. 138

3 March 2005 3/18R. Smith - University of St Thomas - Minnesota Comparing String Objects The boat analogyThe boat analogy –Illustrating the ‘wrongness’ The view in RAMThe view in RAM –Demonstrating the reality Comparison operatorsComparison operators –String st1, st2; –if (st1.equals(“st2”)) … real match –if (st1.compareTo(“st2”) == 0) … real match compareTo returns <0 if st1 < st2compareTo returns <0 if st1 < st2 compareTo returns >0 if st1 > st2compareTo returns >0 if st1 > st2 An Experiment - getInputDialog stringsAn Experiment - getInputDialog strings

4 March 2005 4/18R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1/18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical."

Similar presentations


Ads by Google