-
Notifications
You must be signed in to change notification settings - Fork 0
/
Risk.java
69 lines (53 loc) · 1.76 KB
/
Risk.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
package Git.MiniProject;
public class Risk {
private String riskID;
private String riskName;
private String riskType;
private String riskStatus;
private double probability;
private double impact;
public Risk(String riskID, String riskName, String riskType, double probability, double impact){
this.riskID = riskID;
this.riskName = riskName.toUpperCase();
this.riskType = riskType;
this.probability = probability;
this.impact = impact;
setRiskStatus("To be Addressed");
}
public String getRiskID() {
return riskID;
}
public double getImpact() {
return impact;
}
public double getProbability() {
return probability;
}
public String getRiskName() {
return riskName;
}
public String getRiskType() { return riskType; }
public String getRiskStatus() { return riskStatus; }
public void setRiskID(String riskID) {
this.riskID = riskID;
}
public void setImpact(double impact) {
this.impact = impact;
}
public void setProbability(double probability) {
this.probability = probability;
}
public void setRiskName(String riskName) {
this.riskName = riskName;
}
public void setRiskType(String riskType) { this.riskType = riskType; }
public void setRiskStatus(String riskStatus) { this.riskStatus = riskStatus; }
public double getCalculatedRisk (){
double DIGIT_LIMIT = 100.0;
return (Math.round(this.probability * this.impact * DIGIT_LIMIT)/DIGIT_LIMIT);
}
@Override
public String toString() {
return getRiskName() + " (" + getRiskID() + ")" + ": has a probability of " + getProbability() + " and an impact of " + getImpact();
}
}