title: Program Count Occurrence Given Character String
signature: function program_count_occurrence_given_character_string(s, c)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(s, c, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(s, c), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver("mhjnKfd", 'l', 0);
      @printf("TEST-0...%s\n",result);
      
      result = driver("716662107", '6', 3);
      @printf("TEST-1...%s\n",result);
      
      result = driver("01", '1', 1);
      @printf("TEST-2...%s\n",result);
      
      result = driver("wPHSxIbnHakGRO", 'n', 1);
      @printf("TEST-3...%s\n",result);
      
      result = driver("721106", '8', 0);
      @printf("TEST-4...%s\n",result);
      
      result = driver("111", '0', 0);
      @printf("TEST-5...%s\n",result);
      
      result = driver("TIBFU", 'Q', 0);
      @printf("TEST-6...%s\n",result);
      
      result = driver("0", '3', 0);
      @printf("TEST-7...%s\n",result);
      
      result = driver("10", '0', 1);
      @printf("TEST-8...%s\n",result);
      
      result = driver("lqq", 'd', 0);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def program_count_occurrence_given_character_string(s, c):
      res = 0
      for i in range(len(s)):
          if (s[i] == c):
              res = (res + 1)
      return res
source_cpp: int program_count_occurrence_given_character_string(string s, char c) {
    int res = 0;
    for ( int i = 0;
    i < s . length ( );
    i ++ ) if ( s [ i ] == c ) res ++;
    return res;
  }