title: How can I detect all the capital letters in a string given by the user?
body: <p>So I'm trying to write a method where it detects all the capital letters given by the user. How is this possible? Is it possible to do it using ASCII values? Is it possible in another way? Please give me suggestions and about the best way to come up with this algorithm</p>
  
  <p>NOTE: problem is as stated at bottom of the source CODE</p>
  
  <p><strong>SOURCE CODE</strong></p>
  
  <pre><code>Scanner sc = new Scanner(System.in);
  private String userPassword;
  private char[] passChar;
  private int passwordScore = 0;
  
  public String getPassword(){
      userPassword = sc.nextLine();
      passChar = userPassword.toCharArray();
      return userPassword;
  }
  // Ingore this comment below, this is just for me
  //do for( char i : passChar.length) or actualy if statmen so that if the pass is not 8 charaters long it doesnt qulafiy
  public void passRequirments(){
  
  }
  
  public int passLength(){     
      for(char upperCase: passChar){          
          passwordScore = passwordScore + 4;     
      }
  
      return passwordScore;
   }
  
  
  //THIS IS WHERE IM HAVING TROUBLE 
  public void passUpper(){        
      for (char c : passChar){          
          if (Character.isUpperCase(passChar.charAt(c))){
          }
      }
  }
  </code></pre>
  
  <p><strong>THE PROBLEM</strong></p>
  
  <pre><code>public void passUpper(){ 
        for (char c : passChar){      
            if (Character.isUpperCase(passChar.charAt(c))){
                passwordScore =  passwordScore + ((userPassword.length()- passChar.charAt(c)) * 2);
            }
        }
    }
  </code></pre>