Conditionals and Introduction to Methods
New Terminology
- Defensive programming
- A programming strategy that assumes that something can go wrong, no matter how careful we are.
- Scope
- In programming, the extent to which a variable or method is visible to users of that variable or method.
Programming specific structures and terms
- nested if
- An if/else statement that is inside another if/else structure.
- cascading if
- An if/else series that provides one true based on a series of conditions.
- range
- Using a boolean expression to test for a range of values (from loval to hival)
- switch
- A decision structure consisting of an expression and then a list
of possible values for that expression with the action to take if the
value matches.
- break
- A statement that causes execution to resume following the structure in which it is found.
- scope
- In Java, block scope is the norm for all variables.
Class notes
- Homework review - think, pair, share any that you still have trouble with.
- Review for Wednesday, what are you ok with? What do you specifically want to review?
- Lab Review - MakingCircles.java and Circle.java
- Review of Logical Operators and Nested ifs
- nested if (cascade) - TestResults.java
- nested if (one branch) - LoanQualifier.java
- logical AND - LogicalAnd.java
- logical OR - LogicalOr.java
- comparing characters and Strings - StringCompare.java
- Switch statement - SwitchDemo.java
- An intro to scope - VariableScope.java and Circle.java