title: C++ That Is Plaguing Me To This Day
body: <p>What is the correct solution?
  What is the correct solution?
  What is the correct solution?</p>
  <p><strong>My Code (which is obviously wrong):</strong></p>
  <p><code>&lt;iostream&gt;</code> and <code>&lt;fstream&gt;</code> libraries are included.</p>
  <pre><code>int main() {
  
      int num = 0;
      int totalCount = 0;
      std::ifstream inFile;
      double average = 0.0;
      int totalTwo = 0;
      double total = 0.0;
      const double VALUE_ONE = 858.5;
  
      std::cout &lt;&lt; &quot;What is the number?  &quot;;
      std::cin &gt;&gt; num;
      std::cout &lt;&lt; std::endl;
  
      inFile.open(&quot;numbers.txt&quot;);
      while (inFile &gt;&gt; num) {
  
          totalCount += num;
      }
  
      total =  num * VALUE_ONE;
      average = total/totalCount;
      totalTwo = total * num;
  
     
  
      inFile.close();
  
      return 0;
  }
  </code></pre>
  <p>numbers.txt</p>