title: I Used A Method Before, and Now That Same Method isn't working
body: <p>Here is my code.</p>
  <pre><code>string HCoffees;
          cout
                  &lt;&lt; &quot;\nPlease choose one of these hot coffees. Type your selection here: &quot;
                  &lt;&lt; flush;
          while (cin.get() != '\n')
              ;
          getline(cin, HCoffees);
  
          cout &lt;&lt; &quot;\nNow at the &quot; &lt;&lt; HCoffees &lt;&lt; &quot; section.\n&quot; &lt;&lt; endl;
  
          //If the selection is a Caffe Americano...
  
          if (HCoffees == &quot;Caffe Americano&quot; || HCoffees == &quot;caffe americano&quot;
                  || HCoffees == &quot;Caffe americano&quot; || HCoffees == &quot;caffe Americano&quot;) {
              cout &lt;&lt; &quot;\nWhat size Caffè Americano would you like? &quot; &lt;&lt; flush;
              string size;
              cin &gt;&gt; size;
              if (size == &quot;Tall&quot; || size == &quot;tall&quot;) {
                  cout &lt;&lt; &quot;That will be 2.25.\n\nHow many Caffè Americanos (Tall size) would you like to get?&quot; &lt;&lt; flush;
              }
              else if (size == &quot;Grande&quot; || size == &quot;grande&quot;) {
                  cout &lt;&lt; &quot;That will be 2.65.\n\nHow many Caffè Americanos(Grande size) would you like to get?&quot; &lt;&lt; flush;
              }
              else if (size == &quot;Verti&quot; || size == &quot;verti&quot;) {
                  cout &lt;&lt; &quot;That will be 2.95.\n\nHow many Caffè Americanos(Verti size) would you like to get?&quot; &lt;&lt; flush;
              } else {
                  cout &lt;&lt; &quot;Size not avaliable. Chose a different size: &quot; &lt;&lt; flush;
  
              }
          }
  
      }
  </code></pre>
  <p>Even though Caffe Americano is typed into the console (the user inputed this selection), it does not print out &quot;What size Caffe Americano would you like?&quot; (this is what I had programmed it to do on line 13 if Caffe Americano was typed). I had thought there had been something wrong with the way I got the input of the user, but I was incorrect, because I had already used this same input code* earlier on in my program, and it worked. Please try to solve this. Thanks!</p>
  <p>*input code that is also shown above:</p>
  <pre><code>string HCoffees;
          cout
                  &lt;&lt; &quot;\nPlease choose one of these hot coffees. Type your selection here: &quot;
                  &lt;&lt; flush;
          while (cin.get() != '\n')
              ;
          getline(cin, HCoffees);
  
          cout &lt;&lt; &quot;\nNow at the &quot; &lt;&lt; HCoffees &lt;&lt; &quot; section.\n&quot; &lt;&lt; endl;
  </code></pre>