Roller Coster in C++