Update factory2.cpp

Update the code to use Console::Write/Read instead of cout/cin