Create exercise3.6.cpp