Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str = "There", then after removing all the vowels, str = "Thr". After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. I need help with my C++ code. My code only produces the correct output some of the time, so I'm not sure where I'm going wrong here. I type a word like 'Baseball' and it outputs 'Bsbll.' So it works great, perfect. BUT then I type something like 'Equation' and it only removes some of the vowels.
Here is the prompt:
Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str = "There", then after removing all the vowels, str = "Thr". After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel.
I need help with my C++ code. My code only produces the correct output some of the time, so I'm not sure where I'm going wrong here.
I type a word like 'Baseball' and it outputs 'Bsbll.' So it works great, perfect. BUT then I type something like 'Equation' and it only removes some of the vowels.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images