Chapter 4 Quiz Starting Out With C++ 034

The potential round-off errors are common if the user is not careful when the user uses the equality operator to compare floating point values.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 033

What is the operator that can be used for the logical AND ?

a. &&
b. ++
c. ||
d. @
e. AND

Chapter 4 Quiz Starting Out With C++ 032

What is the value for a relational operation when it is not true?

a. one
b. zero
c. zero, one, or minus one
d. less than zero

Chapter 4 Quiz Starting Out With C++ 031

The following C++ statement will let the variable decide where the program will go to.

a. select
b. associative
c. scope
d. switch
e. none of the above

Chapter 4 Quiz Starting Out With C++ 030

When you use input values, the user should check for the following:

a. Appropriate range
b. Reasonableness
c. Division by zero, if division is taking place
d. All of these
e. None of the above

Chapter 4 Quiz Starting Out With C++ 029

An if statement considers true any value that is NOT 0 (ZERO)

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 028

When a user writes an if statement, the user should indent the statements that get executed conditionally based on programming style.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 027

The switch statement does not require the default section.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 026

If a conditionally-executed code of another if statement contains an if statement, this is called:

a. complexity
b. overloading
c. nesting
d. validation

Chapter 4 Quiz Starting Out With C++ 025

You can ____________ numbers with relational operators.

a. average 
b. add
c. multiply
d. compare

Chapter 4 Quiz Starting Out With C++ 024

What operators can you choose to subtract 1 from their operands.

a. unary
b. minus
c. --
d. relational

Chapter 4 Quiz Starting Out With C++ 023

You may nest for loops like the while and do-while loops.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 022

An initialization expression may be omitted from the for loop if initialization is required.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 021

The condition that is tested by a while loop must be enclosed in parentheses and terminated with a semicolon.

a. True
b. False

Chapter 4 Quiz Starting Out With C++ 020

Using the following word, we mean that we add 1 to the value.

a. modulus
b. decrement
c. increment
d. parse

Chapter 4 Quiz Starting Out With C++ 019

What is the name of a loop that is inside another one?

a. an infinite loop
b. a pre-test loop
c. a nested loop
d. a post-test loop

Chapter 4 Quiz Starting Out With C++ 018

Which of the following is an important part of a while loop:

a. a statement or block that is repeated as long as the expression is true
b. a statement or block that is repeated only if the expression is false
c. one line of code that is repeated once, if the expression is true
d. a statement or block that is repeated once, if the expression is true

Chapter 4 Quiz Starting Out With C++ 017

You can include multiple statements in the body of a while loop, if you enclose them in braces.

a. true
b. false

Chapter 4 Quiz Starting Out With C++ 016

The test condition of a for loop cannot include multiple relational expressions.

a. true
b. false