1570-T1 Flashcards

1
Q

types of integers

A

short int, int, long int

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

short int

A

2 bytes, -32k to + 32k, max val of unsigned short is (2^16) + 1

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

int

A

usually 4 bytes, -2b to +2b

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

long int

A

4 bytes

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

types of floating point

A

float, double, long double

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

float

A

4 bytes, 6 sig figs

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

double

A

8 bytes, 15 sig figs

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

long double

A

19 sig figs (usually)

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

set output precision

A

include <iomanip>, cout << setprecision(# sig figs) << output</iomanip>

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

naming/identifiers

A

alpha numeric and underscore, cannot begin with number

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

non numeric types

A

character, string, boolean, (constant)

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

character

A

~2 bytes

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

string

A

~1 byte per char, cin stops at white space, need getline(cin, myString), also #include <string> for isupper(str), islower(str), and str. length()</string>

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

for non compatible types

A

static_cast <type> (the variable)</type>

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

ascii

A

alpha numeric and special chars, represented by 7 bit binary num, 128 cars defined

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

post/pre increment/decrement

A

can be used with any non bool arithmetic types (can be used for bool to make true for increment)

17
Q

operator precedence

A

(); a++, a - -; ++a, - -a; !; *, /, %; +, -; <, >, <=, >=; ==, !=; &&; ||; =

18
Q

random number generation

A

include <ctime>, #include <cstdlib>, srand(time(nullptr)), for inclusive [min, max] : min + rand() % (max-min+1)</cstdlib></ctime>

19
Q

switch case var types

A

int, char, bool

20
Q

ternary operator

A

cout«(qualifying expression? “true i output”:”else output”) &laquo_space;endl;

21
Q

what does #include<iostream> do?</iostream>

A

tells the compiler that your program is using functions/code defined in the iostream libraries/files