/* * LuckTester.java * * Created on January 7, 2003, 2:51 PM * * Modify this file, and turn in it. Do not change the package name, class name, * or any method signatures. */ package project0; //don't change /** Does the God/Godess of Luck know you? Methods to help answer this urgent * question. * */ public class LuckTester { /** Creates a new instance of LuckTester */ public LuckTester() { } /** Check that a pair of initials is suitable for presentation to the * God/Goddess of Luck. * @param initials A person's initials: must be exactly two uppercase English letters. * @return true iff there are two letters and both are valid (thus avoiding the wrath of the gods). * */ public boolean checkInitials(String initials) { //end checkInitialsArg } /** Given a person's initials, how long does it take the God/Goddess of luck * to recognize that person? Algorithm: Generate pairs of characters randomly until the desired initials are observed. * @param initials A string of exactly two uppercase alphabetic characters; invalid initials risk inciting the wrath of the gods. * @return the number of random pairs which were generated before the initials * were generated. The minimum possible value is 0. * To avoid infinite loops, at most 1,000,000 pairs are tested. */ public int tryUntilSuccess(String initials) { assert initials.length() == 2; //end tryUntilSuccess } /** Report on how lucky a result is. @param a value representing the number of trials needed before the god or * goddess recognized someone's initials; these values are on the same * scale as those produced by the tryUntilSuccess method. * @return an English message explaining or evaluating the result. For example, * it could be "You are truly beloved of Fortuna" or "You need to increase * your offerings or disaster will befall", as appropriate. */ String interpret(double score) { //end interpret } //end class }