title: Post test loop not working when using a char value
body: <p>Ive been trying to get this code to work but im having trouble when i got to the Char value post test, the post test is supposed to loop only if a character that is not "Y" or "N" ("y" or "n") is inputed by the user however it just keep looping regardless of what i input was also wondering if there is a chance that this same problem could occur if i did the same do while loop down below in the insurance plan part of the code? any helps appreciated.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  int main() {
  
      //variables
      double hours = 0;
      double rate = 0;
      double gross = 0;
      double state = 0;
      double fed = 0;
      double local = 0;
      double FICA = 0;
      double netpay = 0;
      double ins = 0;
      double otHrs = 0.0;
      double otPay = 0.0;
      double dep = 0;
      char sol;
      char fam;
  
      //Proccess &amp; check
      do {                                                                    // Hours Post-Check
          cout &lt;&lt; "Enter your hours worked: ";
          cin &gt;&gt; hours;
              if (hours &lt; 0) {
                  cout &lt;&lt; "Enter a number of hours greater than 0" &lt;&lt; endl;
              }
      } while (hours &lt; 0);
  
      do {                                                                    //Pay Post-Check
          cout &lt;&lt; "Enter your hourly pay: ";
          cin &gt;&gt; rate;
              if (rate &lt; 11 || rate &gt; 75) {
                  cout &lt;&lt; "Enter a pay rate that is greater than 11 or less than 75" &lt;&lt; endl;
              }
      } while (rate &lt; 11 || rate &gt; 75);
  
      do {                                                                    //Dependent Post-Check
          cout &lt;&lt; "Enter the number of dependents: ";
          cin &gt;&gt; dep;
              if (dep &lt; 0) {
                  cout &lt;&lt; "Enter a number of dependents greater than 0" &lt;&lt; endl;
              }
      } while (dep &lt; 0);
  
      do {                                                                    //Healthcare Post-Check
          cout &lt;&lt; "Healthcare? (Y/N): ";
          cin &gt;&gt; sol;
          if (sol != 'Y' || 'N') {                                            //Having trouble with this line of code is 
              cout &lt;&lt; "Enter Y or N" &lt;&lt; endl;                                 //This because I am using a Char versus a double/int?
              }                                                               //Im trying to have it loop only if sol does not equal Y or N (y or n)
      } while (sol != 'Y'|| 'N');                                             //It just continues the loop infinitely
                                                                              //will this problem be the same if i try to do this below in the insurance plan?
      //Calculating OverTime
      if (hours &gt; 40) {
          otHrs = hours - 40;
          otPay = (rate * 1.5) * otHrs;
          gross = otPay + 40 * rate;
      }
      else {
          gross = (hours * rate);
      }
  
  
      //Dependents
      if (dep &lt;= 2) {
          fed = 0.18 * gross;
      }
      else if (dep &lt;= 3 &amp;&amp; dep &lt;= 6) {
          fed = 0.15 * gross;
      }
      else if (dep &gt; 6) {
          fed = 0.13 * gross;
      }
      //Deductions
      state = .037 * gross;
      local = .01 * gross;
      FICA = .062 * gross;
      netpay = gross - (state + fed + local + FICA);
  
      //Insurance Y(y) or N(n)
      if (sol == 'Y' || sol == 'y') {                         
          cout &lt;&lt; "Individual or Family plan (I/F): ";
          cin &gt;&gt; fam;
  
          //insurance plan
          if (fam == 'I' || fam == 'i') {
              ins = 35.00;
              netpay -= ins;
          }
          else if (fam == 'F' || fam == 'f') {
              ins = 60.00;
              netpay -= ins;
          }
      }
  
  
  
  
  
  
      cout &lt;&lt; fixed;
      cout &lt;&lt; setprecision(2) &lt;&lt; endl;
      //display
      cout &lt;&lt; "Gross pay:     $" &lt;&lt; setw(11) &lt;&lt; gross &lt;&lt; endl;
      cout &lt;&lt; "Federal tax:  " &lt;&lt; setw(18) &lt;&lt; fed &lt;&lt; endl;
      cout &lt;&lt; "State tax:  " &lt;&lt; setw(20) &lt;&lt; state &lt;&lt; endl;
      cout &lt;&lt; "local tax:  " &lt;&lt; setw(20) &lt;&lt; local &lt;&lt; endl;
      cout &lt;&lt; "FICA tax:  " &lt;&lt; setw(21) &lt;&lt; FICA &lt;&lt; endl;
      cout &lt;&lt; "Health insurance:   " &lt;&lt; setw(12) &lt;&lt; ins &lt;&lt; endl;
      cout &lt;&lt; "--------------------------------" &lt;&lt; endl;
      cout &lt;&lt; "Net Pay:       $" &lt;&lt; setw(11) &lt;&lt; netpay &lt;&lt; endl;
  
      cout &lt;&lt; endl &lt;&lt; endl;
      return 0;
  }
  </code></pre>