public class CountChars {

  // countChars : Takes a string s and a character c, and evaluats to
  // the number of times c appears in s.

  public static void main(String[] args) {
    System.out.println(countChars("It's a sunny day!", 'y'));
    System.out.println(countChars("It's a sunny day!", 'u'));
    System.out.println(countChars("It's a sunny day!", 'x'));
  }

}


/*

  public static int countChars(String s, char c) {
    int total = 0;
    int index = 0;
    while(index <= s.length()) {
      if(s.charAt(index) == c) { total += 1; }
      index += 1;
    }
    return total;
  }


  public static int countChars(String s, char c) {
    int total = 0;
    int index = 0;
    while(index < s.length()) {
      if(s.charAt(index) == c) { total += 1; }
      index += 1;
    }
    return total;
  }


  public static int countChars(String s, char c) {
    int total = 0;
    int index = 0;
    while(index < s.length()) {
      if(s.charAt(index) == c) { total += 1; }
    }
    return total;
  }

  public static int countChars(String s, char c) {
    int total = 0;
    int index = 0;
    while(index < s.length()) {
      if(s.charAt(index) == c) {
        total += 1;
        index += 1;
      }
    }
    return total;
  }

*/
