Question: 2 . 1 vowelsToWordRatio Function Name: vowelsToWordRatio Input: ( 1 times N char ) A string containing words separated by spaces Output: ( double

2.1 vowelsToWordRatio
Function Name: vowelsToWordRatio
Input:
(1\times N char ) A string containing words separated by spaces
Output:
(double) The ratio of vowels to words in the string
Description:
Write a function called vowelsToWordRatio, which takes in a string and returns the ratio of vowels (case
insensitive) to words in the string.
Example:
[ratio1]= vowelsToWordRatio('Go Jackets')
ratio1=1.5000
[ratio2]= vowelsToWordRatio('Every Good Boy Does Fine')
ratio2=1.8000
[ratio3]= vowelsToWordRatio('I am Sam Sam I am I do not like green eggs and
ham')
ratio3=1.1400
Notes:
There will only be letters (upper and lower case) and spaces in the input string
The letters Y and y should NOT be counted as vowels
Round your ratio to two decimal places
Hint: Each word is always separated by a space

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!