Added generate.cpp file containing the main program