import java.util.*; public class ProblemSolver { public static void main(String args[]) { // following constants are questions to be asked (diamonds in flowchart) final String Q_HUMAN = "Are you human?"; final String Q_RESEMBLE_HUMAN = "Do you resemble a human?"; final String Q_MBA = "Do you covet an MBA"; final String Q_BARNEY = "Is Barney more evil than Dr. Doom?"; final String Q_DR_EVIL = "Is Dr. Evil more evil than Dr. Doom?"; final String Q_PROFESSOR = "Are you a professor?"; final String Q_DELL = "Would you serve the Dell guy?"; final String Q_RUN = "You have angered your overlord. Do you run?"; // following constants are resolutions to the problem (ovals) final String A_CODING= "Stick with coding. It is your Destiny!"; final String A_THREAT= "You're a threat to greater evil and will be treated as such."; final String A_LIEUTENANT = "You clearly cower in the presence of evil. You'll make a great lieutenant!"; final String A_MINION = "Your intellect is a bit dubious. You'll make a good minion."; final String A_DOORSTOP= "Well done! You'll make an excellent door stop."; YesNoExtractor extractor = new YesNoExtractor(); // start: Q: are you human? if ( extractor.askUser(Q_HUMAN) ) { // ... } // else if ( ... ) { // ... // } else { } } // end of main } // end of ProblemSolver.java