Chapter 3 Flashcards

(25 cards)

1
Q

standard input object; reads input from console / keyboard; automatically converts data from keyboard to data type of variable used to store it

A

cin

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

stream extraction operator; gets characters from stream object on its left and stores them on variable who’s name appears on its right

A

> > (two arrow heads pointing to right)

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

area of memory where user values are first stored

A

keyboard buffer

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

prgrmming statement that has a value, usually consists of an operator and its operand; don’t have to be mathematical

A

expression

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

dets what goes first when multiple mathematical exps are in use; considered after parantheses

A

precedence

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

precedence table

A

unary operators, arithmetic operators, relational operators, logical operators, assignment operators

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

either L to R or R to L depending on operator; considered after precedence

A

associativity

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

a routine that performs a specific operation

A

library function

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

library fcn whose purpose is to raise a number to a pwr; data types and variable used to store return value must be doubles; requires use of cmath header file

A

pow

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

data types from highest to lowest

A

long double, double, float, unsigned long, long, unsigned int, int

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

when C++ converts operands so the data types they belong to are same type; happens according to these rules: 1) chars, shorts, and unsigned shorts are autoly converted to ints 2) when operator works w/ 2 values of dif data types, conversion takes place b4 operation 3) when final value is assigned to variable it will be converted to data type of variable

A

type conversion

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

when value is converted to higher data type

A

promoted

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

when value is converted to lower data type

A

demoted

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

when value assigned to variable is too large/too small for its data type; for integer, contents wrap around to next value; for floating-pt variables, results depend on how compiler is configured (error messages, stops, choice of behaviors, etc.)

A

overflow/underflow

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

lets you manually promote/demote a value; original value is not changed but a copy is converted and stored in dif data type variable/literal

A

type cast expression; general format: static_cast (value [variable or literal] you want to cast)

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

compound operators; arithmetic assignment operators; have lower precedence than regular math operators

A

combined assignment operators

17
Q

way a value is printed; can be controlled in C++

18
Q

stream manipulator that’s used to estb print fields of a specified width; requires iomanip; can be used w/any data type; by default includes position for decimal pt of floating pt number and space in string

19
Q

min # of spaces /character positions on screen to print value in

20
Q

total # of digits tht appear b4 and after the decimal point

A

sig figs or precision

21
Q

stream manipulator that controls number of sig digits w/which floating-pt values are displayed by; comes directly after value you want to affect; values will be rounded to number of set sig figs; will have no effect if value has less than specified # of digits

22
Q

stream manipulator that forces cout to print digits in fixed-point notation (decimal format)

A

fixed; format: cout &laquo_space;setprecision(#digitsyouwantbehinddecimal) &laquo_space;fixed

23
Q

stream manipulator that allows you to pad numbers w/ trailing zeros, even if there isn’t a fractional part

24
Q

stream manipulators that enable to change justification of output; will stay the same until you change it

A

left and right manipulators

25
spaces, tabs, or newlines
whitespace characters