diff --git a/cs623/proj1/RetirementCalculator.java b/cs623/proj1/RetirementCalculator.java index c1dc94e..02a8cfe 100644 --- a/cs623/proj1/RetirementCalculator.java +++ b/cs623/proj1/RetirementCalculator.java @@ -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); diff --git a/cs623/proj1/RetirementCalculatorModel.java b/cs623/proj1/RetirementCalculatorModel.java index 6e45bfd..66e2336 100644 --- a/cs623/proj1/RetirementCalculatorModel.java +++ b/cs623/proj1/RetirementCalculatorModel.java @@ -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()