title: Why are all of my booleans setting off as true?
body: <p>I tested my code out by printing the values out to see why it did not output the value I should be getting. And I found out all of my booleans that were for the string ride were set off as true and I can not seem to get a clue why. I have tried searching the internet up yet I could not find anything. My understanding of the code is not deep enough for me to understand what is going wrong here.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  
  
  int main() {
    //declarations
    string ride;
    char comp;
    int age;
    double td, tp, god, rp, sp, ta, tap;
    bool fer, bump, zip, pir, test;
  
    //print outs and input
    cout&lt;&lt;&quot;What ride would you like to buy a ticket for? &quot;&lt;&lt;endl;
    getline(cin, ride);
    
    cout&lt;&lt;&quot;How old are you?&quot;&lt;&lt;endl;
    cin&gt;&gt;age;
  
    //functions
    
    //ride
    if (ride == &quot;Ferris Wheel&quot;){
      rp = rp + 75.00;
      fer = true;
    }
    
    if (ride == &quot;Bumper Cars&quot;){
      rp = rp + 50.00;
      bump = true;
    }
    
    if (ride == &quot;Zipper&quot;){
      rp = rp + 100.00;
      zip = true;
    }
    
    if (ride == &quot;The Pirate Ship&quot;){
      rp = rp + 75.00;
      pir = true;
    }
    
    //age
    
    //ferris wheel
    if (fer = true){
      if (age &gt;= 0 &amp;&amp; age &lt;= 7){
          cout&lt;&lt;&quot;Do you have a companion that is at least 18 years old? Y/N&quot;;
          cin&gt;&gt;comp;
          if (comp == 'Y'){
              td = td + .20;
            }
          else{
              cout&lt;&lt;&quot;You need a companion that is at least 18 years old.&quot;;
          }
        }
      else if (age &gt;= 8 &amp;&amp; age &lt;= 12){
          td = td + .10;
      }
    
      else if(age &gt;= 13 &amp;&amp; age &lt;= 20 ){
          td = td + 0.08;
      }
      
      else if(age &gt; 20 &amp;&amp; age &lt; 60){
          td = td + 0.05;
      }
      
    }
    
    //bumper car
    if(bump = true){
      if (age &gt;= 0 &amp;&amp; age &lt;= 7){
          cout&lt;&lt;&quot;Do you have a companion that is at least 18 years old? Y/N&quot;;
          cin&gt;&gt;comp;
          if (comp == 'Y'){
              td = td + .20;
            }
          else{
              cout&lt;&lt;&quot;You need a companion that is at least 18 years old.&quot;;
          }
        }
      
      else if (age &gt;= 8 &amp;&amp; age &lt;= 12){
          td = td + .10;
      }
    
      else if(age &gt;= 13 &amp;&amp; age &lt;= 20 ){
          td = td + 0.08;
      }
      
      else if(age &gt; 20 &amp;&amp; age &lt; 60){
          td = td + 0.05;
      }
      
      else if(age &gt; 60){
          td = td + .20;
      }
    }
    
    //zipline
    if (zip = true){
      if (age &gt;= 0 &amp;&amp; age &lt;= 7){
          cout&lt;&lt;&quot;Do you have a companion that is at least 18 years old? Y/N&quot;;
          cin&gt;&gt;comp;
          if (comp == 'Y'){
              td = td + .20;
        }
      else{
          cout&lt;&lt;&quot;You need a companion that is at least 18 years old.&quot;;
          }
        }
      td = td + 0.10;
    }
    
    // pirate ship
    if (pir = true){
      if (age &gt;= 0 &amp;&amp; age &lt;= 7){
      cout&lt;&lt;&quot;Do you have a companion that is at least 18 years old? Y/N&quot;;
      cin&gt;&gt;comp;
          if (comp == 'Y'){
              td = td + .20;
            }
          else{
              cout&lt;&lt;&quot;You need a companion that is at least 18 years old.&quot;;
          }
        }
        
      else if (age &gt;= 8 &amp;&amp; age &lt;= 12){
          td = td + .10;
      }
    
      else if(age &gt;= 13 &amp;&amp; age &lt;= 20 ){
          td = td + 0.08;
      }
      
      else if(age &gt; 20 &amp;&amp; age &lt; 60){
          td = td + 0.05;
      }
      
      
      
    }
  
     // maths jaajbjabjabjaj B(
     
     cout&lt;&lt;fer&lt;&lt;endl;
     cout&lt;&lt;bump&lt;&lt;endl;
     cout&lt;&lt;zip&lt;&lt;endl;
     cout&lt;&lt;pir&lt;&lt;endl;
     cout&lt;&lt;td&lt;&lt;endl;
     cout&lt;&lt;rp&lt;&lt;endl;
     cout&lt;&lt;td&lt;&lt;endl;
     
     god = rp * td;
     cout&lt;&lt;&quot;discount computed: &quot;&lt;&lt;god&lt;&lt;endl;
     
     sp = rp - god;
     cout&lt;&lt;&quot;sub pirce jajagnkfgdf: &quot;&lt;&lt;sp&lt;&lt;endl;
     
     tap = sp * 0.05;
     cout&lt;&lt;&quot;tap: &quot;&lt;&lt;tap;
     
     ta = sp + tap;
     cout&lt;&lt;&quot;ta: &quot;&lt;&lt;ta;
     
      
      
    
    
    }
  </code></pre>
  <p>input for ride: The Pirate Ship
  input for age: 9</p>
  <p>output i get from code:
  discount i get from code: 30
  partial price : 45
  total price : 47.25</p>
  <p>output i should be getting from code:
  discount i get from code: 7.5
  partial price : 67.5
  total price : 70.875</p>