-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialAccountTransaction.java
More file actions
67 lines (51 loc) · 930 Bytes
/
Copy pathInitialAccountTransaction.java
File metadata and controls
67 lines (51 loc) · 930 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
public class AccountTransaction {
String date;
String type;
double amount;
//Blank constructor
public AccountTransaction()
{
this.date = "";
this.type = "";
this.amount = 0;
}
//Constructor with details
public AccountTransaction(String date, String type, double amount)
{
this.date = date;
this.type = type;
this.amount = amount;
}
//Accessor methods
public String getDate()
{
return this.date;
}
public String getType()
{
return this.type;
}
public double getAmount()
{
return this.amount;
}
//mutator methods
public void setDate(String date)
{
this.date = date;
}
public void setType(String type)
{
this.type = type;
}
public void setAmount(double amount)
{
this.amount = amount;
}
public String toString()
{
return "\n" + "Date = " + this.date + "\n"
+ "Type = " + this.type + "\n"
+ "Amount = " + this.amount + "\n";
}
}