Chapter 3 Questions (Comp Sci)

Ace your homework & exams now with Quizwiz!

A variable can store only ____________________ value(s) at a time.

1

If n = 25 and this statement is executed: n--; , then the new value of n is ____________________.

24

In C++, the ____ symbol is called the assignment operator.

=

This type of statement: sum = sum + 10; is called a(n) ____________________ statement.

accumulation

A(n) ____ statement is the most basic C++ statement for assigning values to variables and performing computations.

assignment

In C++, the = symbol is called the ____________________ operator.

assignment

The stream manipulator ____ displays Boolean values as true and false rather than 1 and 0.

boolalpha

In this statement: int (a * b); , int is a(n) ____________________ operator.

cast

The operator used to force converting a value to another type is the ____ operator.

cast

The ____ statement is used to enter data in a program while it's running.

cin

The ____________________ statement puts the computer in a temporary pause (or wait) state while the user types a value.

cin

In C++, accessing mathematical functions in a program requires including the mathematical header file ____.

cmath

Because of ____, the value assigned to the variable on the left side of the assignment operator is forced into the data type of the variable to which it's assigned.

coercion

The ____ declaration qualifier specifies that the declared identifier is read-only after it's initialized.

const

A(n) ____ expression consists of operators and constants only.

constant

In C++, a variable or symbolic constant must be ____________________ before it has been used.

declared

The ostream class method setf(ios::flush) is equivalent to the stream manipulator ____.

endl

A(n) ____ is any combination of constants, variables, and function calls that can be evaluated to yield a result.

expression

A common programming error in C++ consists of separating all variables passed to cin with an extraction symbol, >>.

false

Numbers sent to cout are normally displayed left-justified in the display field.

false

The stream manipulator lowercase displays hexadecimal digits and the exponent in scientific notation in lowercase.

false

The term ____ refers to an item, such as a variable or argument, that sets a condition usually considered active or nonactive.

flag

A parameterized manipulator takes ____________________ flags as input.

format

When a manipulator requiring an argument is used, the ____ header file must be included as part of the program.

iomanip

In C++, the assignment operator has a(n) ____________________ precedence than any other arithmetic operator.

lower

A(n) ____ can have a value assigned to it.

lvalue

To control the format of numbers displayed by cout, you can include field width ____ in an output stream.

manipulators

Identifiers created with const are commonly referred to as symbolic constants or ____ constants.

named

The number 023 is a(n) ____ number in C++.

octal

Function ____________________ permits using the same function name for different arguments of different data types.

overloading

Another name for a manipulator uses format flags is a ____ manipulator.

paramterized

In C++, the cmath function named ____________________ is used to raise a number to a power.

pow

When the ++ operator appears before a variable it's called a(n) ____ increment operator.

prefix

In C++, arguments of all trigonometric functions (sin(), cos(), and so forth) must be in ____________________.

radians

Programs that detect and respond effectively to unexpected user input are formally referred to as ____________________ programs.

robust

To alter the default justification for a stream of data, you use the ____ manipulator.

setiosflags

The ostream class method precision(n) is equivalent to the stream manipulator ____.

setprecision()

The stream manipulator ____ sets the floating-point precision to n places.

setprecision(n)

In C++, the default precision is set to ____ decimal places.

six

In C++, the mathematical function ____ calculates a number's square root.

sqrt()

In C++, the expression sum = sum + 10 can be written as ____.

sum += 10

In this statement: totalWeight = factor * weight;the arithmetic expression factor * weight is evaluated first to yield a number, which is then stored in the variable ____________________.

totalWeight

Assignment statements can be used to perform arithmetic computations.

true

In C++, all functions, by definition, can directly return at most one value.

true

In addition to outputting integers in decimal notation, the oct and hex manipulators are used for conversions to octal and hexadecimal.

true

Program execution begins with the first statement in the body of the main() function.

true

The display of integer values in one of the three possible number systems (decimal, octal, and hexadecimal) doesn't affect how the number is stored in a computer.

true

The value returned by a C++ mathematical function can be passed as a parameter into another mathematical function.

true

Using a mathematical library function without including the preprocessor statement #include <cmath> is a common programming error in C++.

true


Related study sets

Huckleberry Finn Study Guide (Pre-Ap English 9)

View Set

NWM Exam types of life insurance polices

View Set

Chapter 15- Assessing the Head and Neck

View Set

ATI CH 3-7 NURSING CARE FOR CHILDREN

View Set

Questions Wrong on Chapter 1 Quiz

View Set

Practice Test 3 Questions Answered Wrong

View Set

Assessment of High Risk Pregnancy_EAQ

View Set