A set of general utility classes used for the AP Computer Science courses. Like the course itself, they're in C++. They're basically a bunch of tools to shield the students from some of the messier or more confusing parts of the language. They include:

apstring - A clean string implementation that doesn't involve any messy char *'s. It lets you take substrings, search within the string, and even has a bunch of overloaded operators, such as using '+' to concatenate strings.

apvector - Does everything an array can do in C++ with generally the same syntax. The major improvements are it's ability to resize dynamically. It will also spit out an error message and neatly close the program on an array out of bounds error.

apmatrix - Same idea as apvector, but in two dimensions. Implemented so that it is actually an apvector of apvectors, and works as you'd expect it to. So something like: apmatrix<int> mat(5,4); mat[3].length(); would initialize a 5x4 matrix of integers, then give you the length of the third row in that matrix.

apqueue and apstack - Fully functional and templated classes representing queues and stacks, respectively.

While these may only be useful within the scope of the class, they let you get past some of the initial mess of C++ and move onto the more important and general ideas, which you're really trying to learn in the first place.

Log in or register to write something here or to contact authors.