import java.util.*; public class ProblemSolver { // following constants are questions to be asked (diamonds in flowchart) static final String Q_DOES_IT_WORK = "Does it work?"; static final String Q_IS_IT_YOUR_FAULT = "Did you mess with it?"; static final String Q_WILL_YOU_PAY = "Will you have to pay for it?"; static final String Q_WILL_YOU_BE_FIRED = "Will you be fired for this?"; static final String Q_DID_YOU_FIX_IT = "Did you fix it?"; static final String Q_DOES_ANYONE_KNOW = "Does anybody know?"; static final String Q_CAN_YOU_HIDE_IT = "Can you cover it up?"; static final String Q_CAN_YOU_SHIFT_BLAME = "Can you blame somebody else?"; // following constants are actions to be recommended (squares) static final String A_LEAVE_IT_ALONE = "Leave it alone!"; static final String A_FIX_IT = "The headache starts. Try to fix it."; static final String A_FORGET_IT = "Forget it."; static final String A_TROUBLE = "You're in trouble!"; // following constants are resolutions to the problem (ovals) static final String R_PROBLEM_SOLVED = "No problem."; static final String R_YOU_ARE_SCREWED = "You're screwed."; public static void main(String args[]) { YesNoExtractor extractor = new YesNoExtractor(); if (extractor.askUser(Q_DOES_IT_WORK) == extractor.YES) { System.out.println(A_LEAVE_IT_ALONE); System.out.println(R_PROBLEM_SOLVED); } else { System.out.println(R_YOU_ARE_SCREWED); } } }