If then statements Flashcards
1
Q
if statement
A
- A yes/no question, a conditional
- An if statement basically asks a question (y/n) and conditionally executes certain code based on the answer to that question
2
Q
&&
A
and
3
Q
||
A
or
4
Q
!
A
not
5
Q
order of opperations for logial opperators
A
they act after pemdas, and go && then ||
! acts after parenthases
6
Q
when does mod fall
A
the same time as multiplication and division
7
Q
declare a constant
A
const datatype variable name = assignment
8
Q
3 amjor catagories of ppperators
A
- Logical (&&, ||, !)
- Mathematical (-, +, /, *, %)
- Relational (==, , <=, >=, !=)
9
Q
Three types of If statements?
A
- If - single outcome
- If … Else - dual outcome
- If .. Else if … Else - multi-outcome
10
Q
if
A
if a case is met then the stuff in teh brackets is executed
11
Q
else
A
if the stuff in the iff statement is not executed then this is eecuted
12
Q
elseif
A
if the stuff in the if is not executed then these separate if statemetns are tested