Question: Unreachable statement??????? CSIT 111 home> 313: More string operations E zyBooks catalog Print 'Censored if userinput contains the word 'darn, else print userinput. End with
CSIT 111 home> 313: More string operations E zyBooks catalog Print 'Censored if userinput contains the word 'darn, else print userinput. End with newline Note: These activities may test code with different test values. This activity will perform three tests, with userinput of That darn cat', then with Dang, that was scary!", then with I'm darning your socks.. See How to Use zyBooks . Also 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 1 import java.util. Scanner; 4 public s ing [1 args) String user fogut nostn (iString [I args) String userInput userInput "That darn cat / Your solution goes here / 10if(userInput.indexof ("darn") 1--1)0 13 else( System.out.println(userInput); 19 ) Run Failed to compile main.java:389: error: unreachable statement zyAssertoutput ("Censoredin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
