//An instance of this class represents a Lotto Game Play-Slip // containing several Lotto Game Panels //PUBLIC INTERFACE // Constructor // LotteryGamePlaySlip(int numberOfPanels, int maximumPick) // 1 .. 26 2 .. 99 // Accessors // String getLabels() : Labels of all Panels in the Play-Slip // int getMaximumPick() : Highest pick allowed in any Panel // LotteryGamePanel getPanel(char label) : Reference to a Panel in the Play-Slip // Mutators // void selfPick(char label, int[] picks) : Mark a Panel with self-picks // void quickPick(char label) : Mark a Panel with quick-picks // void cancel(char label) : Mark a Panel as voided //Other Methods // String toString() import java.util.*; public class LotteryGamePlaySlip { //Class Constant - Panel labels are uppercase letters private final String LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //Instance Constants private final String GAME_NAME; //The name of the game in this LotteryGamePlaySlip private final int MAXIMUM_PICK; //Highest pick allowed in this LotteryGamePlaySlip //Instance Variables private LotteryGamePanel[] panels; //The Panels in this LotteryGamePlaySlip //Constructor //Create a new unmarked Lottery game Play-Slip // @param title : name/title of the game in this LotteryGamePlaySlip // @param numberOfPanels: number of panels in this LotteryGamePlaySlip 1 .. 26 // @param maximumPick : highest pick allowed in any LotteryGamePanel 2 .. 99 public LotteryGamePlaySlip(String title, int numberOfPanels, int maximumPick) { //Set the title of the game in this LotteryGamePlaySlip this.GAME_NAME = title; //Set the highest allowed pick (lowest always 1) if ( maximumPick < 2 || maximumPick > 99 ) throw new RuntimeException("Game Max-Pick 2 .. 99 only"); this.MAXIMUM_PICK = maximumPick; //Add unmarked Panels with labels 'A', 'B', ... to this LotteryGamePlaySlip } //Accessor // @return: highest pick allowed in any Panel of this LotteryGamePlaySlip public int getMaximumPick() { return this.MAXIMUM_PICK; } //Accessor // @return: the collected labels of all panels in this LotteryGamePlaySlip public String getLabels() { return null; } //Accessor // @return: the name/title of the game in this LotteryGamePlaySlip public String getGameName() { return this.GAME_NAME; } //Accessor // @return: Reference to a selected Panel of this LotteryGamePlaySlip // @parameter: the Label of the Panel to be selected // @exception: Invalid Panel Label specified public LotteryGamePanel getPanel(char label) { throw new RuntimeException("Invalid Panel Label specified"); } //Mutator //Mark a panel of this LotteryGamePlaySlip as void // @param label: the label of the panel to be voided public void cancel(char label) { } //Mutator //Mark a panel of this LotteryGamePlaySlip with randomly selected picks // @param label: the label of the panel to be marked public void quickPick(char label, int numberOfPicks) { } //Mutator //Mark a panel of this LotteryGamePlaySlip with player-selected picks // @param label: the label of the panel to be marked // @param picks: the picks to be marked selected by the player public void selfPick(char label, int[] picks) { } //Override // @return: A printable image of this LotteryGamePlaySlip public String toString() { return null; } }