click below
click below
Normal Size Small Size show me how
CS II Unit 3
C++ Cengage textbook: D.S. Malik 8th edition (*k): featured in kahoot
| Term | Definition |
|---|---|
| gets data, manipulates it, and outputs results | program 3 operations |
| stream | sequence of characters from source to destination |
| Input stream(*k) | sequence of char from input device to computer |
| Output stream | sequence of characters from computer to output device |
| iostream | header file contains, among other things, definitions of two data types, istream (input stream) and ostream (output stream) |
| common input(*k) | variable cin is named after this("see in") |
| common output(*k) | variable cout is named after this("see out") |
| input stream variables | variables of type istream |
| output stream variables | variables of type ostream |
| stream variable | either input stream variable or output stream variable(note: when defined, never redefine them) |
| >> | binary extraction operator(left: cin, right: variable & reads over white spaces[tabs, new line] when input) |
| input failure | situation: program fails to compile or yields incorrect results because input data does not match corresponding variables |
| istream member functions | functions associated with data type istream |
| stream member functions(stream functions) | I/O functions such as get |
| predefined functions | functions already defined in C++ |
| pow | power function |
| arguments(parameters) | values passed in function call in the parentheses after function name |
| function call | expression transferring control from main function to first statement in body of function, such as pow(2,3) |
| I/O operations | what functions of every programming language preform |
| get | what stream function can cin access |
| ignore | stream function to discard portion of input |
| putback | lets you put last character extracted from input stream by getting function back into the input stream |
| peek | looks into input stream and tells you what next character is without removing it from input stream |
| dot notation | notation: dot separates input stream variable name from member, or function name |
| istream | what are get, ignore, putback, and peek member of |
| member access operator(*k) | dot operator in C++ |
| classes | what data types: istream and ostream called |
| objects | what variables: cin & cout called |
| input failure(*k) | entering char variable into int or double variable will cause |
| fail state | state input stream enters after input failure: all further I/O statements using that stream ignored |
| clear | function to restore input stream to working state(gives program another life) |
| << | insertion operator to display results |
| endl | manipulator for moving output to next line when displaying data |
| setprecision | manipulator control output of floating-point numbers(number of decimal places//sets precision) |
| iomanip | file to include for using setprecision, setw, and setfill manipulators |
| fixed | manipulator to output floating-point numbers in fixed decimal format |
| unsetf | stream member function for undoing fixed manipulator |
| scientific | manipulator to output floating-point numbers in scientific format(default output of floating-point numbers) |
| showpoint | manipulator to force output to show decimal point and trailing zeros(no exponent and will convert number to int by default//sometimes paired with fixed) |
| ' | digit separator for hardcoding |
| setw | manipulator to output expression value(string/number) in specific column number(cumulative in column number) |
| setfill | manipulator to fill unused columns with character other space(used with setw) |
| ostreamVar << setfill (ch); | how to use setfill |
| left(right is to right-justify the output[based on most right character]) | manipulator to left-justify output(based on most left character) |
| ostreamVar << left;(how to use right manipulator: ostreamVar << right) | how to use left manipulator |
| ostreamVar.unsetf(ios::left); | how to undo left manipulator |
| parameterized stream manipulators | manipulators with parameters(needs iomanip header file) |
| getline | Function to read string containing blanks(needs <string> library) |
| file | area in secondary storage to hold information |
| file stream variables | user-declared variables including ifstream and ofstream for input and output |
| opening files | associating file stream variable with input/output source |
| kahoot | kahoot checkpoint(print kahoot) |
| t(iostreams//*k) | output stream is same as input stream(t/f) |
| t(stream var//*k) | stream var either input or output stream variable(t/f) |
| stream member functions(k*) | stream function called |
| function call(ex//*k) | expression pow (2, 3) called ___ |
| f(ignore//*k) | ignore function ignores all of input |
| f(peek&putback//*k) | peek and putback perform same function |