as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
construct an algorithm for counting the number of vowels in a string.
user
algorithm:
1. initialize a counter variable to 0.
2. iterate through every character of the string.
3. if the character is a vowel (a, e, i, o, or u), add one to the counter.
4. repeat steps 2 and 3 until all characters have been processed.
5. return the counter variable.
assistant