title: Strings with if statements
body: <p>This program was just a fun project I thought I'd work on to practice with C++, all it does is calculate the price of a road trip.</p>
  
  <p>All of this coding was typed and compiled using CODE::BLOCKS, it finished with no errors yet when launching the program, the if statements react as if the first if statement listed withing a function is true no matter what I enter. I'm sure the coding is correct yet I feel I may be missing something.</p>
  
  <hr>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Answers.h"
  
  using namespace std;
  
  int main()
  {
  Answers roadTrip;
  roadTrip.intro();
  return 0;
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Answers.h</strong></p>
  
  <pre><code>#ifndef ANSWERS_H
  #define ANSWERS_H
  #include &lt;iostream&gt;
  
  using namespace std;
  
  
  class Answers
  {
  public:
      Answers();
      int intro();
      void dataInput();
      void doubleChecking();
      void incDataInput();
  
      void incDataMpg();
      void incDataGasPrices();
      void incDataDistance();
      int goodbye();
      int finalGoodbye();
  
      int calculations();
  
      int mpg;
      float gasPrices;
      int distance;
  
      string answer;
      string incValue;
  
  
  protected:
  
  private:
  };
  
  #endif // ANSWERS_H
  </code></pre>
  
  <hr>
  
  <p><strong>Answers.cpp</strong></p>
  
  <pre><code>#include "Answers.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  
  
  Answers::Answers(){
  
  }
  
  Answers::intro(){
  cout &lt;&lt; "Hello and welcome to the trip calculator, how may I be of service?" &lt;&lt; endl;
  cout &lt;&lt; "As of now,I am only able to EXIT from this program, or calculate a simple road trip" &lt;&lt; endl;
  cout &lt;&lt; "Which would you like to do, exit, or calculate?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="Calculate"||"calculate"||"Road trip"||"road trip"){
      dataInput();
  }
  
  if(answer=="Exit"||"exit"||"Escape"||"escape"||"Quit"||"quit"){
      return 0;
  }
  }
  
  void Answers::dataInput(){
  cout &lt;&lt; "How many miles to the gallon does your car get?: ";
  cin &gt;&gt; mpg; cout &lt;&lt; "\n";
  
  cout &lt;&lt; "What are the average gas prices along your trip?: ";
  cin &gt;&gt; gasPrices; cout &lt;&lt; "\n";
  
  cout &lt;&lt; "How far away in miles is your destination?: ";
  cin &gt;&gt; distance; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  doubleChecking();
  }
  
  void Answers::doubleChecking(){
  cout &lt;&lt; "Alright, so if I'm not mistaken:" &lt;&lt; endl;
  cout &lt;&lt; "Your car gets " &lt;&lt; mpg &lt;&lt; " miles per gallon" &lt;&lt; endl;
  cout &lt;&lt; "The average price of gas along the trip is $" &lt;&lt; gasPrices &lt;&lt; endl;
  cout &lt;&lt; "And your destination is approximately " &lt;&lt; distance &lt;&lt; " miles away\n" &lt;&lt; endl;
  
  cout &lt;&lt; "Is this information correct?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="Yes"||"yes"||"Y"||"y"){
      calculations();
  }
  
  if(answer=="No"||"no"||"N"||"n"){
      incDataInput();
  }
  }
  
  void Answers::incDataInput(){
  cout &lt;&lt; "Oh? Well that wont be a problem" &lt;&lt; endl;
  cout &lt;&lt; "So what information was entered incorrectly?" &lt;&lt; endl;
  cout &lt;&lt; "Was it MPG, gas prices, or distance?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="MPG"||"mpg"||"Miles per gallon"||"miles per gallon"){
      incDataMpg();
  }
  
  if(answer=="Gas"||"gas"||"Gas prices"||"gas prices"){
      incDataGasPrices();
  }
  
  if(answer=="Distance"||"distance"){
      incDataDistance();
  }
  }
  
  void Answers::incDataMpg(){
  cout &lt;&lt; "So tell me again, how many miles to the gallon does your car get?: ";
  cin &gt;&gt; mpg; cout &lt;&lt; "\n";
  
  cout &lt;&lt; "Your car gets " &lt;&lt; mpg &lt;&lt; " miles per gallon, is that correct?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="Yes"||"yes"||"Y"||"y"){
      doubleChecking();
  }
  
  if(answer=="No"||"no"||"N"||"n"){
      incDataMpg();
  }
  }
  
  void Answers::incDataGasPrices(){
  cout &lt;&lt; "So tell me again, what's the average price of gas along your road trip?: ";
  cin &gt;&gt; gasPrices; cout &lt;&lt; "\n";
  
  cout &lt;&lt; "The average price of gas along the trip is $" &lt;&lt; gasPrices &lt;&lt; ", is that correct?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="Yes"||"yes"||"Y"||"y"){
      doubleChecking();
  }
  
  if(answer=="No"||"no"||"N"||"n"){
      incDataGasPrices();
  }
  }
  
  void Answers::incDataDistance(){
  cout &lt;&lt; "So tell me again, approximately how many miles away is your destination?: ";
  cin &gt;&gt; distance; cout &lt;&lt; "\n";
  
  cout &lt;&lt; "Your destination is approximately " &lt;&lt; distance &lt;&lt; " miles away, is that correct?: ";
  cin &gt;&gt; answer; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  if(answer=="Yes"||"yes"||"Y"||"y"){
      doubleChecking();
  }
  
  if(answer=="No"||"no"||"N"||"n"){
      incDataDistance();
  }
  }
  
  Answers::calculations(){
  int extraMoney = distance*.05;
  int total = (distance/mpg)*gasPrices;
  cout &lt;&lt; "So according to my calculations, in order for your car to travel the " &lt;&lt; distance &lt;&lt; " miles needed" &lt;&lt; endl;
  cout &lt;&lt; "It'd be smart to have at least $" &lt;&lt; total &lt;&lt; "for your overall road trip, but if I were you, I'd consider" &lt;&lt; endl;
  cout &lt;&lt; "making it $" &lt;&lt; total+extraMoney &lt;&lt; "Leaving you " &lt;&lt; extraMoney &lt;&lt; " extra dollars to spend on food an necessities for the trip" &lt;&lt; endl;
  cout &lt;&lt; "I think it should cover " &lt;&lt; distance &lt;&lt; " miles"; cout &lt;&lt; "\n" &lt;&lt; endl;
  
  goodbye();
  }
  
  Answers::goodbye(){
  cout &lt;&lt; "Well, hasn't this been fun? We should do it again sometime. I hope I was able to help you out" &lt;&lt; endl;
  cout &lt;&lt; "That being said, would you like me exit this program?: ";
  cin &gt;&gt; answer;
  
  if("Yes"||"yes"||"Y"||"y"){
      return 0;
  }
  
  if("No"||"no"||"N"||"n"){
      finalGoodbye();
  }
  }
  
  Answers::finalGoodbye(){
  cout &lt;&lt; "Listen, it's nice that you wanna keep me around and all, but literally all I can do is calculate road trips" &lt;&lt; endl;
  cout &lt;&lt; "... and quit out of myself" &lt;&lt; endl;
  
  cout &lt;&lt; "That being said, would you like me exit this program?: ";
  cin &gt;&gt; answer;
  
  if("Yes"||"yes"||"Y"||"y"){
      return 0;
  }
  
  if("No"||"no"||"N"||"n"){
      finalGoodbye();
  }
  }
  </code></pre>
  
  <hr>
  
  <p>Any help would be GREATLY appreciated, I've had the issue before yet I'm still not sure how to fix it.</p>