Write a program that prompts the user to input a string. The program then uses the...

80.2K

Verified Solution

Question

Programming

Write a program that prompts the user to input a string. Theprogram then uses the function substr to remove all the vowels fromthe string. For example, if str=”There”, thenafter removing all the vowels, str=”Thr”. Afterremoving all the vowels, output the string. Your program mustcontain a function to remove all the vowels and a function todetermine whether a character is a vowel.

You must insert the following comments at the beginning of yourprogram and write our commands in the middle:

Write a C++ Program:

/*

// Name: Your Name

// ID: Your ID

// Purpose Statement:~~~

*/

#include

#include

using namespace std;

void removeVowels(string& str);

bool isVowel(char ch);

int main()

{

    string str;

    cout << \"Enter a string: \";

    …

    …

         YOURCODE HERE

    …

    …

return 0;

}

void removeVowels(string& str)

{

    int len = str.length();

    …

    …

         YOURCODE HERE

    …

    …

}

bool isVowel(char ch)

{

    switch (ch)

    …

    …

         YOURCODE HERE

    …

    …

}

Answer & Explanation Solved by verified expert
3.6 Ratings (592 Votes)
Hi There I have included the code    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students