Fix du cas exceptionnel du visiteur de 14 ans qui devait être traité comme un enfant et non comme un adulte

This commit is contained in:
Feror 2025-01-23 12:15:09 +01:00
parent 2294ce5351
commit a93f449d76

View file

@ -5,7 +5,7 @@ public class Visitor {
private FeeCalculationStrategy feeCalculationStrategy; private FeeCalculationStrategy feeCalculationStrategy;
public Visitor (int age) { public Visitor (int age) {
if (age < 14) { if (age <= 14) {
feeCalculationStrategy = new FeeCalculationStartegyForChildren(); feeCalculationStrategy = new FeeCalculationStartegyForChildren();
} else { } else {
feeCalculationStrategy = new FeeCalculationStrategyForAdults(); feeCalculationStrategy = new FeeCalculationStrategyForAdults();