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;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

type casting

A

static_cast<dataType>(variable);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the header file to use random numbers rand() and srand()?

A

<cstdlib>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the header file to use time for random generator?

A

<ctime>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly