Question: This recursive function is supposed to count the number of vowels in a provided string of lower-case letters. So, numvowels (cadeaf) = 3 We

This recursive function is supposed to count the number of vowels in a provided string of lower-case letters.

This recursive function is supposed to count the number of vowels in a provided string of lower-case letters. So, numvowels (cadeaf) = 3 We have provided the beginning of the function for you. The function is initially called with i= input.size() - 1 int numvowels(string input, int i) { if (i < 0) { // TO DO: Write your base case } else { char curr = input[i]; bool isvowel = false; if (curr == 'a' || curr == 'e' || curr == 'i' || curr == 'o' || curr == 'u') isvowel = true; // TO DO: write your recursive case Write both the requested base case, and the requested recursive case.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In the provided code snippet the base case should return 0 when i 0 because it signifies that the en... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!