title: C++ Reading in wrong values from a file
body: <p>My data file contains the following numbers to be read in</p>
  
  <pre><code>/*
  111
  100.00
  200.00
  50.00
  222
  200.00
  300.00
  100
  */
  </code></pre>
  
  <p>but after the while loop reads in customerNumber as 100 when it should be 111, it get's the values for everything else wrong also.  Such as beginningBalance reading as </p>
  
  <pre><code>//-9255963134931783000000000000000000000000.00 
  </code></pre>
  
  <p>and everything else seems to be reading the same value. I'm just learning about files so any help would be greatly appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
  
  int customerNumber;
  double beginningBalance, purchase, payments, financeCharge, endingBalance;
  ifstream inputFile;
  ofstream outputFile;
  
  inputFile.open("BeginningBalance.dat");
  cout&lt;&lt;"Cust No | Beginning Bal | Finance Charge | Purchases | Payments | Ending Balance"&lt;&lt;endl;
  
  while (inputFile &gt;&gt; customerNumber);
      {
       inputFile &gt;&gt; beginningBalance;
       inputFile &gt;&gt; purchase;
       inputFile &gt;&gt; payments;
       financeCharge = beginningBalance * .01;
       endingBalance = beginningBalance + purchase + financeCharge - payments;
       cout&lt;&lt;setw(5)&lt;&lt;customerNumber&lt;&lt;fixed&lt;&lt;setprecision(2)&lt;&lt;"        "&lt;&lt;beginningBalance&lt;&lt;"        "&lt;&lt;financeCharge&lt;&lt;"          "&lt;&lt;purchase&lt;&lt;"       "&lt;&lt;payments&lt;&lt;"       "&lt;&lt;endingBalance&lt;&lt;endl;
      }
  
  
  system ("PAUSE");
  return 0;
  }
  </code></pre>