public class BankCard
extends java.lang.Object
Constructor and Description |
---|
BankCard(int accountNumber,
int correctPIN) |
Modifier and Type | Method and Description |
---|---|
boolean |
cardIsInvalid() |
int |
getAccountNumber() |
void |
makeCardInvalid()
Invalidate a card
|
boolean |
pinIsCorrect(int pin)
Determine whether a given PIN is correct for this card.
|
public boolean pinIsCorrect(int pin)
false
pin
- the PIN that is supposed to be checktrue
iff pin
is correct and the
card is validpublic void makeCardInvalid()
public boolean cardIsInvalid()
true
iff this
card is invalidpublic int getAccountNumber()