chap 3 C++

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Expression

is any combination of constants, variables and functions

coercion

its when assignment operator is converted into data type

The constants 2 and 3.1416 in the assignment statement circum=2 * 3.1416 * radius: are _______

literals

Any expression that is terminated by a ____ become a C++ statement.

semicilon

+=

shortcut assignment operators:

-=

shortcut assignment operators:

/=

shortcut assignment operators:

To calculate the square root of a number, you must include the reference to the library which explains the square root function.

true

The value of pow(x1,x2) is ____

x1 raised to the x2 power

All operands used in an expression must ____ before the expression can be evaluated

have values assigned to them

The const qualifier specifies that the declared identifier can only be read after it is_________

initialized

If n is initialized to the value 5, the expression --n changes the value of n to ______

4

assignment operator

=

The extraction operator used with cin is _____.

>>

validade

Checking that the entered value matches the data type of the variable it's assigned to in a can statement and the value is within an acceptable range for the application

When the computer executes the statement area = length * width; it used whatever values are stored in the variables length and width at the time the assignment is executed. If no values have been specifically assigned to these variable before they are used in the expression length * width, the computer looks ahead to see the values you assign to these variables later in the program.

False

cast operator

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

The operator used to force the conversion of a value to another type is the _____ operator.

cast

prompt

When an output string is used to tell the person at the keyboard what should be typed.

const

a number that stays the same throughout the entire program These variables are normally in all caps. EX: TAXRATE

Professional programmers understand that it is their responsibility to ensure that a program ____ any and all input that a user can possibly enter.

anticipates and appropriately handles

One of the most common C++ programming errors is forgetting to ____ values for all variables that are used in an expression.

assign or initialize

C++ statement

assign values to variables

*=

assignment expression

sqrt()

calculates a number's square root

operand

constant or variable

The cin object is used to enter data into a program while it is ______

executing

The term validate means checking that the entered value _____ the data type of the variable that the value is assigned to within a cin statement.

matches exacly

If b in an integer and d is a double-precision number, the evaluation of the expression b * d is a(n) _____ value.

none of the answers

When a cout statement prints a string that tells the person at the terminal what should be typed, the output string used in this manner is called a(n)

prompt

flag

refers to a item such as variables or argument

sum = sum + 10; can be rewritten using ____ as a shortcut operator.

sum +=10;

Cast

the operator used to force converting a value to another type EX: int (a*b) staticCast <datatype> (expression)

A well-constructed program should validate user input and ensure that a program does not either crash or produce nonsensical output due to unexpected input.

true

An expression is any combination of constants and variables that can be evaluated to yield a result.

true

The statement sum = sum + 10; caused a new value to be stored in sum.

true


Set pelajaran terkait

Cognitive Psych Ch. 11 (Language) Book Questions

View Set

APUSH Unit 3: Chapters 20 and 21

View Set

Module 4- stress, health, and coping

View Set

PMP Exam Chapter 3 Organizations

View Set

9th grade biology evolution vocab

View Set