Question: Starting Code: /* Programmer: Date: Project: Lab 3.5 RemovePhrase File Name: RemovePhrase.java Program Description: Removes a given phrase every time it is appears in a
Lab 3.5-RemovePhrase The goal of this lab is to remove a specific phrase every time it occurs in a sentence. To complete this lab, write a class called RemovePhrase that completes the following tasks. 1. Prompt the user to enter two Strings. One String will contain a sentence. The other String will contain the phrase the user wants to remove from the sentence. Use the nextLine0 method of the Scanner class to receive the user's input values. 2. Use a loop to repeat the following: a. Determine if the phrase appears in the sentence b. Remove the phrase from the sentence. 3. Print the sentence with the phrase removed every time it occurs in the original sentence Below are example outputs for your program sentence "The hero won. phrase "he Output: T ro won sentence "mississippi; phrase ir Output: msssspp sentence # "mississippi". phrase = "s"; Output: miippi sentence "In a battle of cats, the wildcats beat the bobcats 24 10. My cat was happy with the outcome.: phrase "cats
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
