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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

&&

A

and

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

||

A

or

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

!

A

not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

order of opperations for logial opperators

A

they act after pemdas, and go && then ||

! acts after parenthases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

when does mod fall

A

the same time as multiplication and division

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

declare a constant

A

const datatype variable name = assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

3 amjor catagories of ppperators

A
  • Logical (&&, ||, !)
  • Mathematical (-, +, /, *, %)
  • Relational (==, , <=, >=, !=)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Three types of If statements?

A
  • If - single outcome
  • If … Else - dual outcome
  • If .. Else if … Else - multi-outcome
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

if

A

if a case is met then the stuff in teh brackets is executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

else

A

if the stuff in the iff statement is not executed then this is eecuted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

elseif

A

if the stuff in the if is not executed then these separate if statemetns are tested

How well did you know this?
1
Not at all
2
3
4
5
Perfectly