title: Simple JAVA: Password Verifier problem
body: <p>I have a simple problem that says:</p>
  
  <p><em>A password for xyz corporation is supposed to be 6 characters long and made up of a combination of letters and digits. Write a program fragment to read in a string and print out a message as to whether or not the string entered would be considered a valid password.</em></p>
  
  <p>I need help on completing this code. I have this pseudocode that I can't workout into Java code: </p>
  
  <pre><code>print "enter new password"
  input newPassword
  digitCounter =0
  letterCounter = 0
  for I = 0 to newPassword.length() by 1
      c = newPassword.charAt(i)
      if c is a digit
          increment digitCounter
      else if c is a letter
          increment letterCounter
      endif
  endFor
  if newPassword.length() &gt;= 6 and digitCounter &gt; 0 and letterCounter &gt; 0
      print "the password is valid"
  else
      print " password rejected, must be at least 6 characters long and be a mix of letters and digits "
  endif
  </code></pre>
  
  <p>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>
  
  <p>So far all I have is this for the Java code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Password 
  {
      public static void main(String[] args)
      {
          Scanner in = new Scanner(System.in);
  
          String thePassword;
  
          int len, i, letterCounter = 0, digitCounter = 0;
          char c;
  
          Len = thePassword.length();
  
          System.out.print("Enter the password: ");
          thePassword = in.nextLine();
  
          for (i = 0,i = len, )
          {
              c = in.charAt(1);
  
              if ()
          }
  
      }
  }
  </code></pre>