title: Password verification program
body: <p>I need to write a program that allows a user to choose a password. The password has to be a single string of characters that contains no white space.</p>
  
  <ol>
  <li><p>The password must be 6 characters long, must have one lowercase letter, must    have one uppercase letter, and must have at least one digit.</p></li>
  <li><p>When ever the password fails, display error message regarding which one of the criteria isn't met. Be specific with which one to number 1. Then make them re-enter.</p></li>
  <li><p>Once user enters valid password make them verify their original chosen password. If the entry doesn't match make them start all over. If it matches state password if valid.</p></li>
  </ol>
  
  <p>Sample Output:</p>
  
  <pre>
  > Enter your password: Boy1
  
  Password needs to have 6 or more characters.
  
  > Enter your password: women1
  
  Password needs to contain at least one uppercase letter.
  
  > Enter your password: boy
  
  Password needs to have 6 or more characters.
  
  Password needs to contain at least one uppercase letter.
  
  Password needs to contain at least one digit.
  
  > Enter your password: Mtndew1
  
  Now re-enter your password for verification: Mtndew
  
  Password does not match. Start over.
  
  > Enter your password: Mtndew1
  
  Now re-enter your password for verification: Mtndew1
  
  You have now entered a valid password.
  </pre>
  
  <p>Here is what I have so far but don't know how put all this together and make the output function like above we I run it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cctype&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  //Function Prototype
  void testNum(char[],int);
  
  int main()
  {
      const int SIZE = 7; //Array Size
      char password[SIZE]; //To hold password
      int length;
  
      length = strlen(password);
  
      //Get the password.
      do{
          cout &lt;&lt; "Enter your password: ";
          cin.getline(password,SIZE);
          length = strlen(password);
          cout&lt;&lt; "Please enter a password with at least 6 characters.\n";
          cin.getline(password,SIZE);
          length = strlen(password);
      } while (length &lt; 6);
  
      //Call function.
      testNum(password,SIZE);
  
      return 0;
  }
  
  //Function Definition
  void testNum(char pswd[],int size)
  {
  
      int count;
      for (count = 0; count&lt;size-1; count++)
      {
          if (!isupper(pswd[count]))
              cout &lt;&lt; "The password does not contain an uppercase letter.\n";
          if (!islower(pswd[count]))
              cout &lt;&lt; "The password does not contain a lowercase letter.\n";
          if (!isdigit(pswd[count]))
              cout &lt;&lt; "The password does not contain a digit.\n";
      }
  
  }
  </code></pre>