Chapter 3 Flashcards Preview

Programming Fundamentals > Chapter 3 > Flashcards

Flashcards in Chapter 3 Deck (25)
Loading flashcards...
1

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

cin

2

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

>> (two arrow heads pointing to right)

3

area of memory where user values are first stored

keyboard buffer

4

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

expression

5

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

precedence

6

precedence table

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

7

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

associativity

8

a routine that performs a specific operation

library function

9

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

pow

10

data types from highest to lowest

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

11

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

type conversion

12

when value is converted to higher data type

promoted

13

when value is converted to lower data type

demoted

14

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.)

overflow/underflow

15

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

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

16

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

combined assignment operators

17

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

formatting

18

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

setw(n)

19

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

field width

20

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

sig figs or precision

21

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

setprecision

22

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

fixed; format: cout << setprecision(#digitsyouwantbehinddecimal) << fixed

23

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

showpoint

24

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

left and right manipulators

25

spaces, tabs, or newlines

whitespace characters