-
Notifications
You must be signed in to change notification settings - Fork 1
/
Transaction.java
45 lines (36 loc) · 1.27 KB
/
Transaction.java
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
import java.util.*;
import java.io.*;
import java.io.Serializable;
public class Transaction implements Serializable{
private String description;
private double dollarAmount;
private Date date;
private static final long serialVersionUID = 1L;
public Transaction(String description, double dollarAmount) {
this.description = description;
this.dollarAmount = dollarAmount;
this.date = new Date();
}
public void setDescription(String description){
this.description = description;
}
public void setDollarAmount(double dollarAmount){
this.dollarAmount = dollarAmount;
}
public String getDescription(){
return this.description;
}
public double getDollarAmount(){
return this.dollarAmount;
}
public Date getDate(){
return this.date;
}
public String toString(){
return "Date: " + date + "\nDescription: " + description + "\nOrder Total: $" + String.format("%.2f", dollarAmount);
}
//public String toString() {
//String string = "Client ID: " + client.getId() + "\n Name: " + client.getName() + "\n "+ "\n Account Balance: $" + String.format("%.2f", client.getBalance());
//return string;
//}
}