Update Problem C: Pattern Generator.cpp