60 lines
1.2 KiB
Java
60 lines
1.2 KiB
Java
|
|
import java.util.*;
|
|
|
|
public class RetirementCalculatorModel
|
|
{
|
|
/* input fields */
|
|
private double myCurrentIncome;
|
|
private double myIncomeWanted;
|
|
private double myEmployerPension;
|
|
private double myPartTimeIncome;
|
|
private double myOtherIncome;
|
|
private double myAge;
|
|
private double myRetirementAge;
|
|
private double mySavings;
|
|
|
|
/* calculated fields */
|
|
private double mySocialSecurity;
|
|
private double myRetirementIncome;
|
|
|
|
public RetirementCalculatorModel()
|
|
{
|
|
reset();
|
|
}
|
|
|
|
public void reset()
|
|
{
|
|
myIncomeWanted = 0;
|
|
myEmployerPension = 0;
|
|
myPartTimeIncome = 0;
|
|
myOtherIncome = 0;
|
|
myAge = 30;
|
|
myRetirementAge = 65;
|
|
}
|
|
|
|
public void calculate()
|
|
{
|
|
mySocialSecurity = calculateSocialSecurity();
|
|
}
|
|
|
|
private double calculateRetirementFactor()
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
private double calculateSocialSecurity()
|
|
{
|
|
if (myCurrentIncome < 25000.0)
|
|
return 8000.0;
|
|
else if (myCurrentIncome <= 40000.0)
|
|
return 12000.0;
|
|
else
|
|
return 14500.0;
|
|
}
|
|
|
|
private double calculateSavingsFactor()
|
|
{
|
|
return 0.0;
|
|
}
|
|
}
|