import java.util.*; public class ProblemSolver { // following constants are questions to be asked (diamonds in flowchart) static final String Q_ELECTRICITY = "Does it use electricity?"; static final String Q_BUILD_WITH_IT = "Can you build with it?"; static final String Q_IS_IT_WEIRD = "Is it weird?"; static final String Q_DOES_IT_GLOW = "Does it glow?"; static final String Q_IS_IT_BLUE = "Is it Chernobyl blue?"; static final String Q_RED_OR_GREEN = "Is it red and/or green?"; static final String Q_CAN_ZAP_PEOPLE = "Can you zap people with it?"; static final String Q_VIBRATE = "Does it vibrate?"; static final String Q_HEAVY_WATER = "Does it include heavy water as a component?"; static final String Q_CREATE_FEAR = "Will it create fear in the populace?"; // following constants are resolutions to the problem (ovals) static final String A_RETHINK = "Rethink the color and start over"; static final String A_XMAS_LIGHTS = "It'll be used for Xmas lights. You watch."; static final String A_LEGO_PLAYDOH = "Your next gift will be made from lego or play-doh."; static final String A_REGIFTED = "It'll be regifted. Just saying."; static final String A_STRIPED = "It'll be stripped for its parts."; static final String A_LIGHT_SOURCE = "It'll become her or his only light source."; static final String A_GOOD_GIFT = "Now that's a gift! You will be thanked and worhsipped " + "for years to come."; public static void main(String args[]) { YesNoExtractor extractor = new YesNoExtractor(); if ( extractor.askUser(Q_ELECTRICITY) ) { // ... } //else if ( ... ) { // // ... //} else { } } }