filling out more Model functions
git-svn-id: svn://anubis/gvsu@434 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
d0d259ca43
commit
dd5b4a7bf1
@ -16,8 +16,8 @@ class RetirementCalculatorPanel extends JPanel implements ActionListener
|
||||
public RetirementCalculatorPanel()
|
||||
{
|
||||
JPanel inner = new JPanel(new GridLayout(3, 2));
|
||||
JButton b = new JButton("HI");
|
||||
inner.add(b);
|
||||
inner.add(new JLabel("How much annual income will you want in retirement?"));
|
||||
inner.add(new JTextField());
|
||||
JScrollPane scrollpane = new JScrollPane(inner,
|
||||
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
|
||||
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
@ -34,12 +34,7 @@ public class RetirementCalculatorModel
|
||||
|
||||
public void calculate()
|
||||
{
|
||||
if (myCurrentIncome < 25000.0)
|
||||
mySocialSecurity = 8000.0;
|
||||
else if (myCurrentIncome <= 40000.0)
|
||||
mySocialSecurity = 12000.0;
|
||||
else
|
||||
mySocialSecurity = 14500.0;
|
||||
mySocialSecurity = calculateSocialSecurity();
|
||||
}
|
||||
|
||||
private double calculateRetirementFactor()
|
||||
@ -49,7 +44,12 @@ public class RetirementCalculatorModel
|
||||
|
||||
private double calculateSocialSecurity()
|
||||
{
|
||||
return 0.0;
|
||||
if (myCurrentIncome < 25000.0)
|
||||
return 8000.0;
|
||||
else if (myCurrentIncome <= 40000.0)
|
||||
return 12000.0;
|
||||
else
|
||||
return 14500.0;
|
||||
}
|
||||
|
||||
private double calculateSavingsFactor()
|
||||
|
Loading…
x
Reference in New Issue
Block a user