Program 6 for C++ II