title: C++ Loan Calculator
body: <p>I'm trying to write a program in C++ that takes a starting loan balance, the annual interest rate, and a monthly payment and prints a schedule that shows what the balance will be after every month until the loan is paid off or until 60 months have passed. </p>
  
  <pre><code>//Calculates a loan payment schedule
  
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  int main()
  {
  
  double startingBalance = 0.0;
  double interestRate = 0.0;
  double monthlyPayment = 0.0;
  double monthlyBalance = 0.0;
  double compountInterest = 0.0;
  double balance = 0.0;
  int month = 0;
  
  cout &lt;&lt; fixed &lt;&lt; showpoint;
  cout &lt;&lt; setprecision(2);
  
  cout &lt;&lt; "Starting loan balance: " ;
  cin &gt;&gt; startingBalance;  //User input starting loan balance
  if (startingBalance &lt;= 0){
      cout &lt;&lt;"\nPlease enter a positive number: " ;
      cin &gt;&gt; startingBalance;
  }
  cout &lt;&lt; "\nAnnual interest rate: " ;
  cin &gt;&gt; interestRate;  //User input interest rate
  if ((interestRate &lt;= 0) || (interestRate &gt; 1)){
      cout &lt;&lt;"\nPlease enter an interest rate ranging from 0 to 1: " ;
      cin &gt;&gt; interestRate;
  }
  cout &lt;&lt; "\nMonthly payment: " ;
  cin &gt;&gt; monthlyPayment; //User input monthly payment
  if (monthlyPayment &lt;= 0){
      cout &lt;&lt;"\nPlease enter a positive number: " ;
      cin &gt;&gt; interestRate;
  }
  
  startingBalance = balance;
  
  cout &lt;&lt; "\nMonth \t Balance\n" &lt;&lt; endl; //Outputs a schedule of payments
  
  while ((balance &gt; 0) || (month &lt; 61))
  {
      balance += (startingBalance * (interestRate/12));
      balance -= monthlyPayment;
  
      month = month++;
  
      cout &lt;&lt; month &lt;&lt; "\t" &lt;&lt; balance &lt;&lt; "\n";
  
  }
  
  
  
      return 0;
  }
  </code></pre>
  
  <p>I believe statements correct but I keep getting these as result</p>
  
  <pre><code>Starting loan balance: 10000.00
  
  Annual interest rate: 0.0525
  
  Monthly payment: 500.00
  
  Month     Balance
  1         -500.000
  2         -1000.00
  3         -1500.00
  </code></pre>
  
  <p>And so on until 61 months have elapsed.</p>