Some C++ programs for SPS class