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

 Starting Code: /* Programmer: Date: Project: Lab 3.5 RemovePhrase File Name:
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 sentence.
*/
import java.util.*;
public class RemovePhrase{
public static void main( String[] args ){
Scanner keyboard = new Scanner( System.in );
}
}

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!