title: Reading next line from file
body: <p>So the program is supposed to read from the file, which has 4-5 lines of information on it. I can read the first line into the program, and process it through the various algorithms, but I'm not sure how to loop the next line into it and process it as well, again and again until the end of the file. Thank you very much for reading and all input is appreciated. Here is the entire program, with the text read in from file at the bottom.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      ifstream inputFile;
      ofstream invoicefile;
      string name, author, isbn, customerid, filename, fictionoutput, genreoutput;
      char booktype, genre;
      bool fictionvalue;
      double initial_total, tax_price, subtotal, totalprice, price;
      int fee, quantity;
      const double tax(0.07);
  
      cout &lt;&lt; "Enter name of file.\n";
      cin &gt;&gt; filename;
      cout &lt;&lt; "Opening file \n";
      inputFile.open(filename);
  
      if (inputFile.is_open()) {
          inputFile &gt;&gt; customerid &gt;&gt; name &gt;&gt; author &gt;&gt; isbn &gt;&gt; price &gt;&gt; quantity &gt;&gt; booktype &gt;&gt; genre;
  
          //QUANTITY FEE CODING BLOCK
          if (quantity &gt; 50) {
              fee = 50;
          }
          else if (quantity &gt;= 15 &amp;&amp; quantity &lt;= 19) {
              fee = 40;
          }
          else if (quantity &gt;= 10 &amp;&amp; quantity &lt;= 14) {
              fee = 30;
          }
          else if (quantity &gt;= 5 &amp;&amp; quantity &lt;= 10) {
              fee = 20;
          }
          else if (quantity &lt; 5) {
              fee = 10;
          }
  
          //BOOKTYPE CODING BLOCK (FICTION or NON-F)
          if (booktype == 'F') {
              fictionvalue = true;
          }
          else if (booktype == 'N') {
              fictionvalue = false;
          }
          else {
              cout &lt;&lt; "INVALID";
          }
          //BOOKTYPE INTO STRING OUTPUT 
          if (fictionvalue = true) {
              fictionoutput = "Fiction";
          }
          else if (fictionvalue = false) {
              fictionoutput = "Non-Fiction";
          }
  
          //GENRE TYPE INTO STRING OUTPUT
          if (genre == 'R') {
              genreoutput = "Romance";
          }
          else if (genre == 'D') {
              genreoutput = "Drama";
          }
          else if (genre = 'M') {
              genreoutput = 'M';
          }
          else {
              cout &lt;&lt; "Invalid entry\n";
          }
  
          //NO FEE EXCEPTION
          if (booktype == 'N' &amp;&amp; genre == 'R') {
              fee = 0;
          }
  
  
          //CALCULATION OF PRICE + TAX CODING BLOCK
          initial_total = (price*quantity);
          tax_price = (initial_total * tax);
          subtotal = (initial_total + tax_price);
          totalprice = (subtotal + fee);
  
  
  
          //OUTPUT TO FILE/CONSOLE CODING BLOCK
          cout &lt;&lt; "-----------------------------------------" &lt;&lt; endl;
          cout &lt;&lt; "Order Invoice" &lt;&lt; endl;
          cout &lt;&lt; "Customer ID: " &lt;&lt; customerid &lt;&lt; endl;
          cout &lt;&lt; name &lt;&lt; " " &lt;&lt; author &lt;&lt; " " &lt;&lt; fictionoutput &lt;&lt; " " &lt;&lt; genreoutput &lt;&lt; " " &lt;&lt; quantity &lt;&lt; "@" &lt;&lt; price &lt;&lt; "Subtotal: " &lt;&lt; endl; //add subtotal price
          //cout &lt;&lt; "Total book sales: " &lt;&lt;
          cout &lt;&lt; "Tax: " &lt;&lt; tax_price &lt;&lt; endl;
          cout &lt;&lt; "Subtotal: " &lt;&lt; subtotal &lt;&lt; endl;
          cout &lt;&lt; "Fee: " &lt;&lt; fee &lt;&lt; endl;
          cout &lt;&lt; "Total Price: " &lt;&lt; totalprice &lt;&lt; endl;
  
          cout &lt;&lt; "-----------------------------------------" &lt;&lt; endl;
          system("pause");
      }
  
  }
  </code></pre>
  
  <p>TEXT SAMPLE</p>
  
  <pre><code>1234 Dog_Strategy Henry_Moreno 3-598-21500-2 12.99 5 N M
  6789 Companion_Kicked_Me_Out Lorraine_Johnson 3-598-21599-1 24.99 3 F R
  3444 Mime_On_My Journey Kristy_Wahl 3-699-21500-8 6.75 10 N D
  4455 Damaged_By_The_Joke Henry_Christopher   3-598-21500-2 12.99 4 N R
  </code></pre>