-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.java
More file actions
37 lines (30 loc) · 997 Bytes
/
Copy pathTransaction.java
File metadata and controls
37 lines (30 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.sql.Date;
/*
* Each transaction that is made in the ATM will be stored as this object. Transactions include (and
* are not limited to): withdrawing, depositing, last four digits of cc number when card is put into
* the machine, number of invalid pin code attempts, the amount of money left in the machine after
* each withdraw or deposit.
*/
abstract class Transaction {
// the time that the transaction took place
private Date transDate;
private Integer transNumber;
// the account that the transaction belongs to
Account acc;
public Date getTransDate() {
return transDate;
}
public int getTransNumber() {
if (this.transNumber == null) {
this.transNumber = Utilities.randNumber(100000, 10000000);
}
return this.transNumber;
}
public void setTransDate(Date transDate) {
this.transDate = transDate;
}
public float getAmount() {
// TODO Auto-generated method stub
return 0;
}
}