Question: Part A): Write a Java program that asks the user to enter a phrase with a word repeated 3 times in it and a String
Part A): Write a Java program that asks the user to enter a phrase with a word repeated 3 times in it and a String to replace those repeated words with. An example of the program output: Enter a phrase with 3 words in it repeated: a dog, a second dog, and a third dog Enter the word that is repeated: dog Enter a string: nice cat New Phrase: a nice cat, a second nice cat, and a third nice cat
Part B): Write a Java program that asks the user to enter a phrase with a word repeated 3 times in it and three different words to use as a replacement. An example of the program output: Enter a phrase with 3 words in it repeated: my dog, your dog, our dog Enter the word that is repeated: dog Enter the replacement for the first occurrence: cat Enter the replacement for the second occurrence: bird Enter the replacement for the third occurrence: horse
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
