Mid-term Flashcards
1
Q
Write a cout statement so the variable divSales is displayed in a field of 8 spaces, in fixed-point notation, with a precision of 2 decimal points. The decimal point should always be displayed.
A
cout << setw(8) << fixed << showpoint << setprecision(2) << divSales;
2
Q
type casting
A
static_cast<dataType>(variable);
3
Q
What is the header file to use random numbers rand() and srand()?
A
<cstdlib>
4
Q
What is the header file to use time for random generator?
A
<ctime>