/**
 * This exercise requires the completion of a function that counts the number of vowels in a given string.
 * The function should use a while loop to iterate through each character of the string and count the number of vowels.
 * Vowels include 'a', 'e', 'i', 'o', and 'u'.
 *
 * @param text The string to be analyzed.
 * @return The total number of vowels present in the string.
 */
fun countVowels(text: String): Int {

    // Initialize the counter variable for vowels
    var vowelsCount = 0
    
    // Initialize the index and length variables for the while loop
    var i = 0
    val length = text.length
    
    while (i < length) {
        // Check if the current character is a vowel
        if (text[i].toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
            // If it is, increment the counter
            vowelsCount++
        }
        
        // Increment the index for the next iteration
        i++
    }
    
    return vowelsCount
}
/**
 * This exercise requires the completion of a function that counts the number of vowels in a given string.
 * The function should use a while loop to iterate through each character of the string and count the number of vowels.
 * Vowels include 'a', 'e', 'i', 'o', and 'u'.
 *
 * @param text The string to be analyzed.
 * @return The total number of vowels present in the string.
 */
fun countVowels(text: String): Int {
/**
 * This exercise requires the completion of a function that counts the number of vowels in a given string.
 * The function should use a while loop to iterate through each character of the string and count the number of vowels.
 * Vowels include 'a', 'e', 'i', 'o', and 'u'.
 *
 * @param text The string to be analyzed.
 * @return The total number of vowels present in the string.
 */
fun countVowels(text: String): Int {

    // Initialize the counter variable for vowels
    var vowelsCount = 0
    
    // Initialize the index and length variables for the while loop
    var i = 0
    val length = text.length
    
    while (i < length) {
        // Check if the current character is a vowel
        if (text[i].toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
            // If it is, increment the counter
            vowelsCount++
        }
        
        // Increment the index for the next iteration
        i++
    }
    
    return vowelsCount
}