/**
 * Write a function that takes a string and a character as input. The function should return the number of occurrences
 * of that character in the string. Use loops and an else statement to solve this exercise.
 *
 * @param string The input string.
 * @param char The character to be searched in the string.
 * @return The number of occurrences of the character in the string.
 */
fun countOccurrences(string: String, char: Char): Int {

    var count = 0
    for (letter in string) {
        if (letter == char) {
            count++
        }
    }
    return count
}
/**
 * Write a function that takes a string and a character as input. The function should return the number of occurrences
 * of that character in the string. Use loops and an else statement to solve this exercise.
 *
 * @param string The input string.
 * @param char The character to be searched in the string.
 * @return The number of occurrences of the character in the string.
 */
fun countOccurrences(string: String, char: Char): Int {
/**
 * Write a function that takes a string and a character as input. The function should return the number of occurrences
 * of that character in the string. Use loops and an else statement to solve this exercise.
 *
 * @param string The input string.
 * @param char The character to be searched in the string.
 * @return The number of occurrences of the character in the string.
 */
fun countOccurrences(string: String, char: Char): Int {

    var count = 0
    for (letter in string) {
        if (letter == char) {
            count++
        }
    }
    return count
}