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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started