Ch 4 - Gaddis Flashcards

1
Q

Relational operators

A

Relational operators allow you to compare numeric and char values and determine whether one is greater than, less than, equal to, or not equal to another.

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

if statement

A

The if statement can cause other statements to execute only under certain conditions.

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

Expanding the if statement

A

The if statement can conditionally execute a block of statements enclosed in braces.

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

The if/else statement

A

The if/else statement will execute one group of statements if the expression is true, or another group of statements if the expression is false.

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

Nested if statements

A

To test more than one condition, an if statement can be nested inside another if statement.

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

The if/else if statement

A

the if/else if statement tests a series of conditions. It is often simpler to test a series of conditions with the if/else statement than with a set of nested if/else statements.

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

Flags

A

A flag is a boolean or integer variable that signals when a condition exists.

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

Logical operators

A

Logical operators connect two or more relational expressions into one, or reverse the logic of an expression.

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

Checking numeric ranges

A

Logical operators are effective for determining whether a number is in or out of a range.

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

Menus

A

You can use nested if/else statements or the if/else if statement to create menu-driven programs. A menu-driven program allows the user to determine the course of action by selecting it from a list of actions.

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

Validating user input

A

As long as the user of a program enters bad input, the program will produce bad output. Programs should be written to filter out bad input.

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

Comparing characters and strings

A

Relational operators can also be used to compare characters and string objects.

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

Conditional operator

A

You can use the conditional operator to create short expressions that work like if/else statements.

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

Switch statement

A

The switch statement lets the value of a variable or expression determine where the program will branch.

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

Blocks and variable scope

A

The scope of a variable is limited to the block in which it is defined.

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