Phrase-O-Matic exercise from Head First Java