public class LotteryTicket extends Object
Modifier and Type | Field and Description |
---|---|
static int |
QUOTA_NUMBERS_DRAWN
invariant: the quota of numbers which can be drawn, i.e.
|
static int |
VAL_MAX
invariant: the highest number which can be written
on any lottery ticket
|
Constructor and Description |
---|
LotteryTicket(int n,
int m)
Constructor for objects of class LotteryTicket
|
Modifier and Type | Method and Description |
---|---|
void |
autofill()
Autofiils a ticket with random numbers
|
void |
list()
Prints to System.out the contents of this ticket
|
void |
readNumbers()
Accepts numbers to write on this tiicket from System.in
and writes them on the ticket
|
String |
toString()
Returns a String with the numbers on this lotto ticket
|
int[] |
whatNumbers()
returns an array of numbers written on this ticket
|
public static final int QUOTA_NUMBERS_DRAWN
public static final int VAL_MAX
public LotteryTicket(int n, int m)
n
- how many numbers one can write on a ticketm
- highest value which can be written on a ticketpublic void autofill()
public void list()
public void readNumbers()
public String toString()
public int[] whatNumbers()