Term pt.4(conditionals) Flashcards

1
Q

Control Flow

A

Control Flow is the order in which statements are executed in a program. The default control flow is for statements to be read and executed in order from left-to-right, top-to-bottom in a program file.

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

Control Structures

A

Conditionals such as ( if statements and the like ) alter control flow by only executing blocks of code if certain conditions are met. These structures essentially allow a program to make decisions about which code is executed as the program runs.

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

Logic Operator ( || )

A

The logical OR operator ( || ) checks two values and returns a boolean. If one or both values are truthy, it returns ( true ). If both values are falsy, it returns ( false ).

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

Else Statement

A

An ( else ) block can be added to an ( if ) block or series of ( if - else if ) blocks. The ( else ) block will be executed only if the ( if ) condition fails.

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

Else Statement

A

An ( else ) block can be added to an ( if ) block or series of ( if - else if ) blocks. The ( else ) block will be executed only if the ( if ) condition fails.

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

Logical Operator ( && )

A

The Logical AND operator ( && ) checks two values and returns a boolean. If both values are truthy, then it returns ( true ). If one, or both, of the values is falsy, then it returns ( false ).

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

If Statement

A

An ( if ) statement accepts an expression with a set of parentheses. If the expression evaluates to a truthy value, then the code within its code body executes vice versa for a falsy value.

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

If Statement

A

An ( if ) statement accepts an expression with a set of parentheses. If the expression evaluates to a truthy value, then the code within its code body executes vice versa for a falsy value.

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

Logical Operator ( ! )

A

The logical NOT operator ( ! ) can be used to do one of the following:
invert a Boolean value.
invert the truthiness of non-Boolean values.

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