diff --git a/cs623/proj1/RetirementCalculatorModel.java b/cs623/proj1/RetirementCalculatorModel.java index b795ca1..19ea7d4 100644 --- a/cs623/proj1/RetirementCalculatorModel.java +++ b/cs623/proj1/RetirementCalculatorModel.java @@ -44,6 +44,33 @@ public class RetirementCalculatorModel setField("social security", calculateSocialSecurity()); } + private double calculateMakeUpFactor() + { + int retire_age_index = (int) getField("retirement age"); + int life_expectancy_index = (int) getField("life expectancy"); + + if (retire_age_index == 55) retire_age_index = 0; + else if (retire_age_index == 60) retire_age_index = 1; + else if (retire_age_index == 70) retire_age_index = 3; + else retire_age_index = 2; + + if (life_expectancy_index == 86) life_expectancy_index = 1; + else if (life_expectancy_index == 89) life_expectancy_index = 2; + else if (life_expectancy_index == 92) life_expectancy_index = 3; + else if (life_expectancy_index == 94) life_expectancy_index = 4; + else if (life_expectancy_index == 97) life_expectancy_index = 5; + else life_expectancy_index = 0; + + final double makeup_factors[] = { + 18.79, 20.53, 21.71, 22.79, 23.46, 24.40, + 16.31, 18.32, 19.68, 20.93, 21.71, 22.79, + 13.45, 15.77, 17.35, 18.79, 19.68, 20.93, + 10.15, 12.83, 14.65, 16.31, 17.35, 18.79 + }; + + return makeup_factors[retire_age_index * 6 + life_expectancy_index]; + } + private double calculateRetirementFactor() { return 0.0;