how to change user input from integer to decimal
<p>I'm new to java and was wondering how to change a user input (integer) into decimal form. for ex, if the user inputs 6 for yearly interest, it will be changed to 0.06 before the calculations are done and the answer is printed. </p>

<p>this program is just used to determine how long a bank account will last.. but I am also supposed to print this in a year and month format. I'm not sure how to do that, except to put in another if statement and say if (answer from the above calculations > 12) subtract 12 from the calculations and add1 to year.. and somehow put that in a loop. </p>

<p>if anyone has advice/pointers to give on doing this it'd really be helpful! </p>

<pre><code>import java.util.*;

class Two {
  public static void main(String[] args) {
    Scanner imp = new Scanner(System.in);
    System.out.print("Enter your initial balance: ");
    double bal = imp.nextDouble();
    System.out.print("Enter your yearly interest: ");
    double intr = imp.nextInt();
    System.out.print("Enter your monthly withdrawls: ");
    double wtd = imp.nextDouble();
    if (true) { //need to change 
      System.out.print("Your account will last " + (((bal*intr) + bal)/ wtd) + " months");
    } else { System.out.print("The account will last forever");

    }
  }
</code></pre>

<p>}</p>
