Chapter 2 - First Program Flashcards

1
Q

Comments

A
// comment here
/* comment more than one line */
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

“Are they not equal?”

A

!=

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

“Are they equal?”

A

==

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

Logical AND

A

&&

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

NOT

A

!()

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

OR

A

||

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

BOOL type

A

holds the outcome of a conditional statement, is an alias for an int, and is zero if “false” and 1 if true typically

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

Header for BOOL

A

include

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

IF ELSE

A
if (conditional)
{
        execute this statement
}
else 
{
       execute this statement instead
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ELSE IF

A
if (conditional)
{
        execute this statement
}
else if (conditional2)
{
       execute this statement instead
}
....
else 
{
       // do this instead 
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CONDITIONAL TERNARY OPERATOR

A
int V = Boolean ? x:y
- if the boolean is TRUE then V takes the value of x
- otherwise if the boolean is FALSE then V takes the value of y. 
A more concise way of writing
\_\_\_\_\_\_\_\_
if (Boolean)
{
    V = x;
}
else
{
    V = y;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly