Create factory2.cpp

based on the code from 
http://www.codeproject.com/Articles/363338/Factory-Pattern-in-Cplusplus
still need optimize