Transcribed Image Text: Write an Octave function called cale_num_vowels.m that takes as input a string of any length. The string can contain spaces. The function

Transcribed Image Text: Write an Octave function called cale_num_vowels.m that takes as input a string of any length. The
string can contain spaces. The function must determine the number of vowels in the string and the
location of the vowel in the string. The function must return two output parameters, namely the number
of vowels and an array with the location of the vowel in the string. The program should perform the
following functionality:
(i)
(ii)
Read a string from the command window as shown in example below.
Get the string lenglh.
(iii) Check each character in the string – if the character is a space then continue. If the character
is a vowel, then store the location and increment the number of vowels.
(iv) Return the number of vowels and the vowel location array.
The function must test that there is an input argument.
(v)
(vi)
The function must print an error message if there are less than two input arguments.
(vii) Hint: Use a vector array to store the element number in the string where the vowel occurs –
see example below where the vowel “i” is element 3.
Example: You can test your function with the following test string:
[num, arr] = calc_num_vowels(This Is A TesT’)
num = 4
arr = 3 6 9 12

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer