COSC-1337 Chapter 3 Flashcards
“Prompt”
Lets the user know that input is expected and prompts them as to what they must enter.
A cin object must always be preceded by a “prompt”
What symbol is this? - “»”
Stream-extraction Operator
Gathering input from a users requires what process?
- “Prompting” the user to enter input
2. Using cin object to read input from the keyboard
“Input Buffer” or “Keyboard Buffer”
This is an area of memory where input from the keyboard is temporarily placed before it is converted to the correct value and stored in its variable.
What is an “Expression”?
Is something that can be evaluated to produce a single value.
“Associativity”
is the order in which an operator works with its operands. It is either left-to-right or right-to-left.
What is this for?: algebra = pow(4.0, 2);
It is the variable algebra that has an expression of 4 being raised to the second power.
What header file must be included in order to use the pow function?
What is “type coercion”?
When C++ automatically converts two values to the same type when used with an operator.
char, short, and unsigned short are automatically converted to which type?
int data type
An operator working with a lower value data type and a higher value data type will be promoted to what data type?
The higher value variable data type
When the final value of an expression (with an operator) is assigned to a variable what happens?
It is converted to the data type assigned to the variable
What happens when a floating point number is converted to an int?
It is “truncated” and the decimal gets left out
A ________ lets you manually promote or demote a value
“type cast expression”
What does this do?: static_cast(Value)
This is type conversion. It can be used to convert the data type of a variable to another.
What type cast is this?: pennies = (double)dollar;
Prefix Notation
What type conversion is this?: pennies = float(dollar);
Functional notation