Required Minimum Distribution Calculation not working
<p>I am trying to make an app for the Android that does RMD calculations.  The program, however, keeps giving 0.0.</p>

<p>I think that my problem lies in this code:</p>

<pre><code>package com.MinDis.android;

import java.util.*;
import java.text.*;

public class RMD
{
 double balance;
 double rmd;
 long age;
 String bdate;
 SimpleDateFormat sd = new SimpleDateFormat("MM/dd/yyyy");

 Date current = new Date();
 public void setBalance(double i)
 {
  balance = i;
 }

 public double getBalance()
 {
  return balance;
 }

 public void setBDate(String h)
 {
  bdate = h;
 }

 public long getAge() throws Exception
 {

  Date birthd = sd.parse(bdate);
  long cur;
  long birth;
  long diff;

  cur = current.getTime();
  birth = birthd.getTime();
  diff = cur - birth;
  age = (diff/(24*60*60*1000))/365;
  return age;
 }

 public double getRMD()
 {

  if (age == 70)
  {
   rmd = balance/27.4;
  }

  if (age == 71)
  {
   rmd = balance/26.5;
  }

  if (age == 72)
  {
   rmd = balance/25.6;
  }

  if (age == 73)
  {
   rmd = balance/24.7;
  }

  if (age == 74)
  {
   rmd = balance/23.8;
  }

  return rmd;
 }
}
</code></pre>

<p>I tried using .equals(), but it complained that I was trying to dereference the long value.  Also, I am aware that java.util.Date is deprecated, but I don't want to try the other classes. From my first Android app, I figured out the "==" does not work, but I am not sure what to do here.</p>

<p>I have verified that the input for a balance and the birthdate values were accepted, so that is how I limited it to this particular class.</p>
