title: Java program using compound growth
body: <p>So here is what the brief for the program says: "According to CNNMoney.com, Facebook hit 1 billion users in October 2012. Using the compound-growth technique you learned in Fig 4.6 and assuming its user base grows at a rate of 4% per month, how many months will it take to grow its user base to 1.5 billion users? How many months will it take for Facebook to grow its user base to 2 billion users?"</p>
  
  <p>I have the program "working" but I feel as if it is not calculating the values correctly.  I also don't know if I am using the most current or efficient Java techniques. I am definitely a beginner so any suggestions or pointers will be much appreciated.  Here is what I have so far!</p>
  
  <pre><code>package programmingassignment4.pkg32;
  
  public class ProgrammingAssignment432 {
  
      public static void main(String[] args) {
          int user= 1000000000;
          int user2= 1000000000;
          double total1 = 0;
          double total2 = 0;
          int grandtotal1=0;
          int grandtotal2=0;
          int i = 1;
          int j=1;
          for(i=1; user&lt;=1500000000; i++)
          {
             total1 = user*(.04);
             user+=total1;
          }
          System.out.print("The total number of months to reach 1.5 billion users will be : " + i + "\n");
          for(j=1;user2&lt;=2000000000;j++)
          {
              total2 = user2*(.04);
              user2+=total2;
          }
          System.out.print("The total number of months to reach 2 billion users will be : " + j);
     }
  }
  </code></pre>