Write a program that reads in a line of text and replaces allfour-letter words w
ID: 3616749 • Letter: W
Question
Write a program that reads in a line of text and replaces allfour-letter words with the word "love". For example, the inputstringI hate you, you dodo!
should produce the output
I love you, you love!
Of course, the output will not always make sense. For example,the input string
John will run home.
should produce the output
Love love run love.
If the four-letter word starts with a capital letter, itshould be replaced by "Love", not by "love". You need not checkcapitalization, except for the first letter of a word. A word isany string consisting of the letters of the alphabet and delimitedat each end by a blank, the end of the line, or any other characterthat is not a letter. Your program should repeat this action untiluser says to quit. Write a program that reads in a line of text and replaces allfour-letter words with the word "love". For example, the inputstring
I hate you, you dodo!
should produce the output
I love you, you love!
Of course, the output will not always make sense. For example,the input string
John will run home.
should produce the output
Love love run love.
If the four-letter word starts with a capital letter, itshould be replaced by "Love", not by "love". You need not checkcapitalization, except for the first letter of a word. A word isany string consisting of the letters of the alphabet and delimitedat each end by a blank, the end of the line, or any other characterthat is not a letter. Your program should repeat this action untiluser says to quit.
Explanation / Answer
please rate - thanks #include #include using namespace std; int main() {string input; int i,length,len,prev=-1; char a; do { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.