CSC 222: Computer Programming II
Spring 2004

Test 1 Review

C++ review program structure, input/output variables, constants, expressions functions, parameters (by-value & by-reference), default parameters control statements: if, if-else, while, for strings, arrays Object-oriented programming class = abstract data type (ADT); object = instance of class using existing class: #include, member function call user-defined class: private vs. public, data fields (instance variables) + member functions (methods) constructor separate compilation, header (.h) + implementation (.cpp) files enumerated types (enum) Vectors and arrays disadvantages of arrays (static size, no bounds check, odd parameters, ...) vector declaration, templates member functions: [], size, resize, push_back, back, pop_back resizable vs. growable vectors const-reference parameter passing Class design object-oriented design: first identify objects, model as classes interacting classes structuring data, parallel vectors private member functions