-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCertificateOfDeposit.java
73 lines (58 loc) · 1.98 KB
/
CertificateOfDeposit.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* CertificateOfDeposit
*/
import java.util.GregorianCalendar;
public class CertificateOfDeposit {
private int certificateNumber;
private String name;
private float balance;
private GregorianCalendar issueDate;
private GregorianCalendar maturityDate;
public CertificateOfDeposit(){
this.certificateNumber = 0;
this.name = "";
this.balance = 0.0f;
issueDate = new GregorianCalendar();
maturityDate = issueDate;
maturityDate.set(GregorianCalendar.YEAR, issueDate.get(GregorianCalendar.YEAR)+1);
}
public CertificateOfDeposit(int certificateNumber, String name, float balance , GregorianCalendar issueData) {
this.certificateNumber = certificateNumber;
this.name = name;
this.balance = balance;
this.issueDate = issueData;
this.maturityDate = issueData;
this.maturityDate.set(GregorianCalendar.YEAR, GregorianCalendar.YEAR+1);
}
public int getCertificateNumber() {
return certificateNumber;
}
public void setCertificateNumber(int certificateNumber) {
this.certificateNumber = certificateNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getBalance() {
return balance;
}
public void setBalance(float balance) {
this.balance = balance;
}
public GregorianCalendar getIssueDate() {
return issueDate;
}
public void setIssueDate(int year, int month, int day) {
this.issueDate = new GregorianCalendar(year, month, day);
this.maturityDate.set(GregorianCalendar.YEAR, issueDate.get(GregorianCalendar.YEAR)+1);
}
public GregorianCalendar getMaturityDate() {
return maturityDate;
}
public void setMaturityDate(GregorianCalendar maturityDate) {
this.maturityDate = maturityDate;
}
}