Problem

Write a program that reads in a line of text and replaces all four-letter words with the w...

Write a program that reads in a line of text and replaces all four-letter words with the word “love”. For example, the input string

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, it should be replaced by “Love”, not by “love”. You need not check capitalization, except for the first letter of a word. A word is any string consisting of the letters of the alphabet and delimited at each end by a blank, the end of the line, or any other character that is not a letter. Your program should repeat this action until the user says to quit

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 8
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT