Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java problem Trying to censor the unwanted word with *, however it censors every word that has the unwanted word in it. How to only

Java problem

Trying to censor the unwanted word with *, however it censors every word that has the unwanted word in it. How to only censor the unwanted word itself regardless of the captial letter? Thanks

Sample output:

please enter the paragraph you would like filtered: Applepie applejuice Appleorange applebanana apple Apple

please enter the word you would like to filter: apple

output: Applepie applejuice Appleorange applebanana ***** *****

image text in transcribedimage text in transcribed

import java.util.Scanner; public class Random public static void main(String[l args) Scanner input - new Scanner(System.in); System.out.println("Please enter the paragraph you would like filtered: "); string paragraph = input.nextLine(); System.out.println("Please enter the word you would like to filter:" string wo rd = input.nextLine(); System.out.println("Unfiltered: "paragraph) String filter = ""; for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions