public class TicketMachine
extends java.lang.Object
Constructor and Description |
---|
TicketMachine(int ticketCost)
Create a machine that issues tickets of the given price.
|
Modifier and Type | Method and Description |
---|---|
int |
getBalance()
Return the amount of money already inserted for the
next ticket.
|
int |
getPrice()
Return the price of a ticket.
|
void |
insertMoney(int amount)
Receive an amount of money in cents from a customer.
|
void |
printTicket()
Print a ticket.
|
public TicketMachine(int ticketCost)
public int getBalance()
public int getPrice()
public void insertMoney(int amount)
public void printTicket()