public class LotteryDraw extends Object
Modifier and Type | Field and Description |
---|---|
static int |
QUOTA_NUMBERS_DRAWN
class invariant: a value used to determine the quota of numbers
taht can be drawn
|
static int |
VAL_MAX
class invariant: the highest number value that can be drawn
for any LotteryDraw object
|
Constructor and Description |
---|
LotteryDraw()
Constructor LotteryDraw objects
parameterless; constructs a 6 out of 49
|
LotteryDraw(int n,
int m)
Constructor LotteryDraw objects
|
Modifier and Type | Method and Description |
---|---|
void |
checkWins(LotteryTicket b)
Check to see which numbers on the given ticket match the draw
Writes to System.out the matching ones
|
void |
draw()
Executes a draw
|
void |
list()
Prints info on this lottery
|
String |
toString()
Returns a String representation of this LotteryDraw object
|
public static final int QUOTA_NUMBERS_DRAWN
public static final int VAL_MAX
public LotteryDraw()
public LotteryDraw(int n, int m)
n
- how many numbers are drawnm
- highest drawn valuepublic void checkWins(LotteryTicket b)
b
- a LotteryTicket object to check against this drawpublic void draw()
public void list()