Unit 3 Flashcards
boolean value
true or false
< (less than operator)
(when r=5) radius < 0 = false
<= (less than or equal to)
(r=5) radius <= 0 false
> (greater than)
(r=5) radius > 0 = true
> = (greater than or equal to)
(r=0) radius >= 0 true
== (equal to)
radius == 0 is false
!= (not equal t0)
radius != 0 is true
selection statements
allow programs to run statements based on a condition, must be boolean
if statement
specifies alternate routes to a program
one-way if statement
only one decision bridge made in a program
two-way if-else statement
catches for true or false scenario
curly braces for logic
Logic statements must have their own curly braces in the program
redundancy tests
ensure that your logic statements are not overly complicated
multi-way if-else statement
if any of the conditions are true, then none of the other conditions will be met
dangling else
not adding curly braces to the logic statement