IAT 265 Lecture Notes - Lecture 6: Ellipse, Boolean Expression

110 views2 pages

Document Summary

Boolean expressions are statements that can one of two values: true or false. == equal note the difference between =, which is the assignment operator. If statement if statements are used to allow your code to follow different paths depending on a condition. The concept: if the statement is true, do the following bit of code. The basic pattern: if( boolean expression ) { //statements if - else statements use a boolean expression to determine which path to take through the code. The basic pattern: if ( boolean_expression ){ if ( other_boolean_expression ){ // more statements if statements can be nested to deal with sub conditions. You can put an if statement anywhere you can put a set of statements: method, loop, if, where ever it is needed. Switch is a shortcut to using a long series of if-else statements. You can only switch on ints, bytes, shorts, chars.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents