C++ Program 1, will revise at a later date