Wraping into functions; tests pass
Finish Write ex1.cpp into functions