CHALLENGE АCTIVITY 19.16.3: Using indexOf(). Print "Censored" if userlnput contains the word "darn", else print userlnput. End with newline. Ex: If userlnput is "That darn cat.", then output is:...


Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn cat.", then output is:Censored


Ex: If userInput is "Dang, that was scary!", then output is:Dang, that was scary!


Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.


CHALLENGE<br>АCTIVITY<br>19.16.3: Using indexOf().<br>Print

Extracted text: CHALLENGE АCTIVITY 19.16.3: Using indexOf(). Print "Censored" if userlnput contains the word "darn", else print userlnput. End with newline. Ex: If userlnput is "That darn cat.", then output is: Censored Ex: If userlnput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message. 365076.2342078.qx3zgy7 1 import java.util.Scanner; 2 3 public class CensoredWords { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); String userInput; 4 7 8 userInput = scnr.nextline(); 9 10 * Your solution goes here */ 11 } 13 } 12

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here