Week 4 Flashcards

1
Q

What is type casting?

A

Manually promoting / demoting

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

What does the syntax of type casting (explicit)

A

static_cast(Value);

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

What is overflow?

A

When a number can’t fit into its data type.

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

What is underflow?

A

When floating point numbers get too close to zero.

Needs more digits of precision

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

How to use a named constant?

A

Const double INTEREST_RATE = .129;

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

what is a #define directive

A

a text replacement, not c++ code, no semi colon

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

what is an example of multiple assignment?

A

a = b = c =12;

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

What is combined assignment?

A

+=

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

what is the set width manipulator syntax?

A

setw();

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

what does the set width manipulator do?

A

Sets the minimum number of spaces to do, right justified

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

What must you do to use setw(), fixed(), ect

A

include

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

what does setprecision(n) do?

A

Sig figs when it is by its self, sets digits after decimal with fixed.

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

what does showpoint do?

A

forces the decimal point

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

what does fixed do?

A

prevent scientific notation

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