//An instance of this class represents a Lotto Game Panel to record // a Lotto player's selections (numbers) for a Lotto game. //PUBLIC INTERFACE // Constructor // LotteryGamePanel(char label, int maxPick) // Accessors // char getLabel() : the label (identifier) // int[] getPicks() : the selected numbers // boolean isQuickPick() : true (quick-pick), false (self-pick) // boolean isMarked() : true iff any pick (>= 1) is marked // boolean isVoided() : true iff panel is marked void //Mutators // void mark(int numberOfPicks) : mark quick-picks // void mark(int[] picks) : mark self-picks // void mark() : mark voided //Other Methods // String toString() // import java.util.*; public class LotteryGamePanel { //Instance Variables private final char label; //Identifier of this Panel: 'A', 'B', 'C', 'D', ..... private boolean[] isPicked; //Records the player's picks in this LotteryGamePanel //isPicked[0]: true iff this LotteryGamePanel has been voided //isPicked[i]: true iff number i has been picked (i > 0) private boolean isQuickPick; //true iff this LotteryGamePanel is a QuickPick Panel //Constructor //Create a new unmarked LotteryGamePanel of picks 1 .. maxPick // @param label : The identifier for this LotteryGamePanel // @param maxPick : The highest available pick in this LotteryGamePanel public LotteryGamePanel(char label, int maxPick) { this.label = ' '; } //Accessor // @return The label of this LotteryGamePanel public char getLabel() { return this.label; } //Accessor // @return: null if this LotteryGamePanel is voided or un-marked // @return: array of all the picks marked in this LotteryGamePanel public int[] getPicks() { return null; } //Accessor // @return true iff this LotteryGamePanel is a quick-pick panel public boolean isQuickPick() { return false; } //Accessor // @return true iff this LotteryGamePanel has been voided public boolean isVoided() { return false; } //Accessor // @return true iff this LotteryGamePanel has been marked public boolean isMarked() { return false; } //Mutator //Mark this LotteryGamePanel with randomly selected picks // @param numberOfPicks: number of picks to be marked in this LotteryGamePanel public void mark(int numberOfPicks) { Random generator = new Random(); } //Mutator //Mark this LotteryGamePanel with picks selected by the player // @param picks : the player's self-selected picks public void mark(int[] picks) { } //Mutator //Mark this LotteryGamePanel as void public void mark() { } //Override // @return a printable image of this LotteryGamePanel // Example (not marked) B: // Example (voided) B: VOID // Example (self pick) B: 01 02 12 28 40 51 // Example (quick pick) B: 10 11 18 31 39 40 QP public String toString() { return null; } }