/**
 * Given a list of animals, this function prints information about each animal using string formatting and looping structures.
 *
 * @param animals A list containing the names of different animals.
 */
fun printAnimalInfo(animals: List<String>) {

    for (animal in animals) {
        val animalName = animal.capitalize()

        // Get the total number of characters in the animal name
        val nameLength = animalName.length

        // Check if the name has odd or even number of characters
        if (nameLength % 2 == 0) {
            println("The animal $animalName has an even number of characters in its name.")
        } else {
            println("The animal $animalName has an odd number of characters in its name.")
        }

        // Loop through the characters of the animal name
        for ((index, char) in animalName.withIndex()) {
            if (index == 0 || index == nameLength - 1) {
                // Print the first and last characters of the name
                println("The ${index + 1}st/nd character of $animalName is '$char'.")
            }

            // Determine if the character is a vowel
            if (char.toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
                println("The character '$char' in $animalName is a vowel.")
            }
        }
    }
}
/**
 * Given a list of animals, this function prints information about each animal using string formatting and looping structures.
 *
 * @param animals A list containing the names of different animals.
 */
fun printAnimalInfo(animals: List<String>) {
/**
 * Given a list of animals, this function prints information about each animal using string formatting and looping structures.
 *
 * @param animals A list containing the names of different animals.
 */
fun printAnimalInfo(animals: List<String>) {

    for (animal in animals) {
        val animalName = animal.capitalize()

        // Get the total number of characters in the animal name
        val nameLength = animalName.length

        // Check if the name has odd or even number of characters
        if (nameLength % 2 == 0) {
            println("The animal $animalName has an even number of characters in its name.")
        } else {
            println("The animal $animalName has an odd number of characters in its name.")
        }

        // Loop through the characters of the animal name
        for ((index, char) in animalName.withIndex()) {
            if (index == 0 || index == nameLength - 1) {
                // Print the first and last characters of the name
                println("The ${index + 1}st/nd character of $animalName is '$char'.")
            }

            // Determine if the character is a vowel
            if (char.toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
                println("The character '$char' in $animalName is a vowel.")
            }
        }
    }
}