Implement a POASTchecker. The POASTchecker will analyse a post number and use heuristic processing to determine whether the number is a /proggles/number, i.e. it will either acknowledge ``dubs'', ``trips'', or ``jackson five GET''. Any reasonable input and output format is allowed.
imageredditor thinks there are meme arrows on /prog/ wew lad
Name:
Anonymous2017-01-23 21:33
>>5 nobody posted any erlang here so we can't compete with it
Name:
Anonymous2017-01-24 11:26
speaking of /proggles/, check my sweet dubs
Name:
Anonymous2017-01-24 14:03
>>11 manual work that could be automated, but no, that would eliminate jobs for illegal migrants
Name:
Anonymous2017-01-24 15:00
>>12 there are already two POASTchecker implementations with dubs support in this thread, they just need to be deployed
Name:
Anonymous2017-01-24 15:50
EXPERIENCED ENTERPRISE ARCHITECT SOLUTION
public class Constants { public static int THE_NUMBER_ZERO = 0; public static int THE_NUMBER_TWO = 2; public static int THE_NUMBER_THREE = 3; public static int THE_NUMBER_FIVE = 5; public static int THE_NUMBER_TEN = 10;
public static int THE_JACKSON_FIVE_CONSTANT = THE_NUMBER_FIVE;
public static String DUBS_MESSAGE = "DUBS"; public static String TRIPS_MESSAGE = "TRIPS"; public static String JACKSON_FIVE_GET_MESSAGE = "JACKSON FIVE GET"; public static String TRY_AGAIN_NEXT_TIME_MESSAGE = "TRY AGAIN NEXT TIME"; }
public abstract class CheckRule { public abstract boolean check(int em); public abstract String congratulations(); }
public abstract class CheckConstantPostNumberRule extends CheckRule { int theConstantToCheck;
public String check(int em) { for (int i=Constants.THE_NUMBER_ZERO; i<checkingRules.length; i++) if (checkingRules[i].check(em)) return checkingRules[i].congratulations(); return Constants.TRY_AGAIN_NEXT_TIME_MESSAGE } }
public class POASTChecker extends AbstractPostChecker { POASTChecker() { super(new CheckRule[]{new CheckBase10DubsRule(), new CheckBase10TripsRule(), new JacksonFiveCheckRule()}); } }
public class POASTCheckerTHE_NUMBER_FIVETest { public static void main(String[] args) { POASTChecker thePOASTChecker = new POASTChecker(); System.out.println(thePOASTChecker.check(Constant.THE_NUMBER_FIVE)); } }
Name:
Anonymous2017-01-25 7:22
>>14 almost good but you're using raw constructors. factories would be eneterprisier