Week 4 Flashcards
What is type casting?
Manually promoting / demoting
What does the syntax of type casting (explicit)
static_cast(Value);
What is overflow?
When a number can’t fit into its data type.
What is underflow?
When floating point numbers get too close to zero.
Needs more digits of precision
How to use a named constant?
Const double INTEREST_RATE = .129;
what is a #define directive
a text replacement, not c++ code, no semi colon
what is an example of multiple assignment?
a = b = c =12;
What is combined assignment?
+=
what is the set width manipulator syntax?
setw();
what does the set width manipulator do?
Sets the minimum number of spaces to do, right justified
What must you do to use setw(), fixed(), ect
include
what does setprecision(n) do?
Sig figs when it is by its self, sets digits after decimal with fixed.
what does showpoint do?
forces the decimal point
what does fixed do?
prevent scientific notation