title: How do I make multiple if statements inside one another taking user input in C++?
body: <p>so I am new to programming, especially with C++ and I am trying to write a bank program, where I am currently trying to make the person an &quot;account&quot; asking them if they want to make a Basic, Premium, or Elite account, and then confirming the account with a yes or no answer from the user. Here is my code:</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
  
      string mystr;
      cout &lt;&lt; &quot;Hello there, which account would you like to start today? Basic, Premium or Elite? &quot;;
      getline(cin, mystr);
  
      string yn_answer;
      if (mystr == &quot;Elite&quot;) {
          cout &lt;&lt; &quot;You have chosen the Elite account option. Is this correct? (y/n): &quot;;
          getline(cin, yn_answer);
          if (yn_answer == &quot;y&quot;)
              cout &lt;&lt; &quot;Great, setting up account... \n&quot;;
          cout &lt;&lt; &quot;25% complete. \n&quot;;
          cout &lt;&lt; &quot;50% complete. \n&quot;;
          cout &lt;&lt; &quot;75% complete. \n&quot;;
          cout &lt;&lt; &quot;100% complete. \n&quot;;
          cout &lt;&lt; &quot;Process complete. \n&quot;;
      }
      else {
          cout &lt;&lt; &quot;I'm sorry for the inconvenience, please restart the program. Thanks! &quot;;
      }
  
      if (mystr == &quot;Premium&quot;) {
          cout &lt;&lt; &quot;Hello, Premium&quot;;
      }
  
      if (mystr == &quot;Basic&quot;) {
          cout &lt;&lt; &quot;Hello, Basic&quot;;
      }
  
      if (mystr != &quot;Basic&quot;, &quot;Elite&quot;, &quot;Premium&quot;) {
          cout &lt;&lt; &quot;I'm sorry, you did not choose one of the following options above. Please try again.&quot;;
      }
  
      return 0;
  }
  </code></pre>
  <p>Currently I only have the first one, Elite, done and the Basic and Premium will be copied over when I can figure out how to get it to work. However, when I try to run this by typing Elite in as the user input I get the character output, &quot;I'm sorry, you did not choose one of the following options above. Please try again.&quot;, from the last line trying to check if the user entered in something other than Elite, Basic, or Premium.</p>
  <p>If I type in something other than the three options, I should get &quot;I'm sorry, you did not choose one of the following options above. Please try again&quot;. However, I get the first &quot;error&quot; message that is supposed to be checking for the user confirming the account type as well as the actual error message I am supposed to be getting.</p>
  <p>I'm very new to programming, and I don't really know how to explain these things. If you don't understand something I'm trying to do, please let me know and I'll try to explain it better. Also, is there a way that I can do this better, or is there a way to fix what I am doing here? Thanks.</p>
  <p>*Also, I've heard that using namespace for std isn't a good practice to do, but I'm currently using an online compiler and that was how it was originally and I don't want to change things around now after working on this and mess it up more than it already is. I've been working on this for a while and have been fixing it up until this point where I don't know how to fix it.</p>