/**
 * This exercise requires you to write a function that counts the number
 * of times a particular character appears in a given string. Your task
 * is to complete the code by filling in the missing parts.
 *
 * @param string A string to be analyzed.
 * @param char The character that needs to be counted.
 * @return The number of times the character appears in the string.
 */
fun countAppearances(string: String, char: Char): Int {

    var count = 0

    // Iterate over each character in the string
    for (c in string) {
        // Check if the current character matches the desired character
        if (c == char) {
            // Increment the count if a match is found
            count++
        }
    }

    return count
}
/**
 * This exercise requires you to write a function that counts the number
 * of times a particular character appears in a given string. Your task
 * is to complete the code by filling in the missing parts.
 *
 * @param string A string to be analyzed.
 * @param char The character that needs to be counted.
 * @return The number of times the character appears in the string.
 */
fun countAppearances(string: String, char: Char): Int {
/**
 * This exercise requires you to write a function that counts the number
 * of times a particular character appears in a given string. Your task
 * is to complete the code by filling in the missing parts.
 *
 * @param string A string to be analyzed.
 * @param char The character that needs to be counted.
 * @return The number of times the character appears in the string.
 */
fun countAppearances(string: String, char: Char): Int {

    var count = 0

    // Iterate over each character in the string
    for (c in string) {
        // Check if the current character matches the desired character
        if (c == char) {
            // Increment the count if a match is found
            count++
        }
    }

    return count
}