C++ Early Objects Ch. 4

C++ Early Objects Ch. 4

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

input validation

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

4 years ago

Date created

Mar 14, 2020

Cards (21)

Section 1

(21 cards)

input validation

Front

when a program lets the user know that an invalid menu choice has been made, this is an example of

Back

The ____ operator is used in C++ to test for equality

Front

==

Back

What will the following statement do if x equals 17 and answer = 20? answer = x > 100 ? 0 : 1;

Front

Assign 1 to answer

Back

What will the following expression evaluate to? !(6 > 7 || 3 ==4)

Front

True

Back

Which of the following correctly declares an enumerated data type named student?

Front

enum student { Bill, Tom, Mary};

Back

A trailing else placed at the end of an if/else if statement provides a default action when ____ of the if conditions is/are true.

Front

none

Back

The _____ statement executes one block of statements if a test condition is true, and another block if the condition is false.

Front

if/else

Back

Flag

Front

A(n) _____ is a variable, usually a bool, that signals when a condition exists.

Back

The ____ operator is known as the logical OR operator

Front

&

Back

The default section of a switch statement performs a similar task the ____ portion of an if/else if statement.

Front

trailing else

Back

The ____ statement executes one statement, or block of statements, if a condition is true and skips it, doing nothing, if the condition is false.

Front

if

Back

bool

Front

A flag is a variable, usually a data type ______, that signals whether or not some condition exists.

Back

if

Front

The ____ statement causes other program statements to execute only under certain conditions.

Back

Nested if

Front

When an if statement is placed within the conditionally-executed code of another if statement, this is known as a(n)

Back

True/False: The scope of a variable is the program it is defined in.

Front

False

Back

The ____ statement acts like a chain of if statements. Each performs its test, one after the other, until one of them is found to be true or until the construct is exited without any test ever evaluation to true.

Front

if/else if

Back

Relational operators allow you to _____ numbers

Front

compare

Back

If s1 and s2 are string objects, s1 == s2 is true when

Front

None of these because in each case one or more characters in the strings have different ASCII codes

Back

In C++ when a relational expression is false, it has the value

Front

0

Back

The C++ _____ operator represents logical AND.

Front

&&

Back

!

Front

The _____ operator takes an operand and reverses its truth or falsehood.

Back