In this program, you ask user to enter a sentence and read it using string class function getline. Use a for loop to iterate through all characters. Please use sr.ta(i) method to access each string character. If a character is a vowel, replace it with "_". Both upper and lower case vowels have to be replaced, Those who use an array for string are going to lose points as char.at(i) verifies that the character position in a string is valid.
Example run:
Please enter a sentence:
Hello There!
You entered the sentence "Hello There!"
Your sentence after replacing vowels by underscore is H_ll_ Th_r_!