-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRiskEvaluator.java
31 lines (27 loc) · 985 Bytes
/
RiskEvaluator.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
package Git.MiniProject;
public class RiskEvaluator{
public String name (String name){
name = name.toUpperCase();
return name;
}
public double probability (double probability){
double leastValue = 0.0;
double maxValue = 1.0;
while (probability < leastValue || probability > maxValue){
System.out.println("Enter a value between 0.0 and 1.0 ");
probability = new KeyboardInput().positiveDouble();
probability = new RiskEvaluator().probability(probability);
}
return probability;
}
public double impact (double impact){
double leastValue = 0.0;
double maxValue = 10.0;
while (impact < leastValue || impact > maxValue){
System.out.println("Enter a value between 0.0 and 10.0 ");
impact = new KeyboardInput().positiveDouble();
impact = new RiskEvaluator().impact(impact);
}
return impact;
}
}