CPSC 225, Spring 2002 Information for the First Test ------------------------------------------------------------------------------ The first test for this course will be given in class on Friday, February 22. It will cover material from Chapters 1 through 7, Chapter 9, and Section 12.1. You should expect the test to include a mixture of coding, reading code, definitions, and short essay questions. Coding can include short code segments as well as complete functions, classes, and programs. Here are some terms and topics you should be familiar with: program structure in C++ #include namespaces the standard namespace, std standard header files: iostream, string, fstream, cmath, cstdlib cin and cout operators >> and << for I/O control structures: if, for, etc. types: int, double, char, bool variable declaration and initialization expressions and assignment statements const in variable declarations enumerated types with enum functions function prototypes declaration versus definition parameters overloading of functions returning a value from a function passing parameters by value passing parameters by reference default parameter values arrays arrays as parameters two-dimensional arrays struct classes comparison of structs and classes member of a class member variable member function static member function public and private defining member functions outside the class constructors calling constructors with and without parameters accessor and mutator functions const applied to formal parameters const member functions C-style strings the null character, '\0' the C++ string class the ifstream and ofstream classes opening and using files stream error-checking functions: bad(), fail() ifstream functions: get(ch), peek(), eof() the getline(istream,string) function random numbers: rand(), RAND_MAX, srand(time(0)) the g++ compiler