1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gekata [30.6K]
3 years ago
11

Print "Censored' if userlnput contains the word "darn, else print userlnput. End with newline. Ex: If userinput is "That darn ca

t., 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. 1 import java.util.Scanner; 3 public class CensoredWords 4public static void main ( 1 test passed String args) Scanner scnr -new Scanner(System.in); String userInput; A tests passed userInput scnr.nextLine); 10 Your solution goes here 12 13 Run
Computers and Technology
1 answer:
sasho [114]3 years ago
6 0

Answer:

The code is given below in Java with appropriate comments

Explanation:

//Import the input.

import java.util.Scanner;

class CensoredWords

{

    //Define the main method.

    public static void main(String args[ ])

    {

         //Define the variables.

         String userInput="" ;          

         //Define the scanner object

         Scanner scobj = new Scanner(System.in);

          //Accept the userInput.

         System.out.print("Enter String: ");

         userInput=scobj.nextLine();

         //Check if the input contains darn.

         //Print censored.

         if(userInput.toUpperCase().indexOf("DARN") != -1)

         System.out.printf("Censored");

         //IF the input does not contains darn

         //Print userInput.

         else

System.out.printf(userInput)

         return;

}

}

You might be interested in
Show that ALLDFA is in <img src="https://tex.z-dn.net/?f=%5Cmathrm%7BP%7D" id="TexFormula1" title="\mathrm{P}" alt="\mathrm{P}"
Alexandra [31]

Answer:

Hypothesis testing is a vital process in inferential statistics where the goal is to use sample data to draw conclusions about an entire population. In the testing process, you use significance levels and p-values to determine whether the test results are statistically significant.

Explanation:

yup it is write

3 0
1 year ago
What is the python print of (“5”+”7”)?
Firdavs [7]

Answer:

57

Explanation:

Since the 5 and the 7 don't represent integers instead they represent strings so it would come out as 57 hope I helped!

4 0
3 years ago
Assessment timer and count Assessment items Item 6 How many different keys can be used in a single sort? 1 2 3 4
Alik [6]

Answer:

Its C 3. hope this helps

Explanation:

6 0
3 years ago
If a preferred (faster) learned route over a WAN has administrative distance 110 that competes with a static backup (slower) rou
almond37 [142]

The engineer will need to set the distance to 130 for the static link so that it becomes a floating static route.

<h3>What is Floating static routes?</h3>

This is known to be a static routes that is said to have a kind of administrative distance that is also known to be bigger than the administrative distance of any other static route or dynamic routes.

Note that the value 130 stands for the next most logical value, nd as such it is to know that the right route comes first in the steps for administrative distance.

Learn more about WAN from

brainly.com/question/11352260

5 0
2 years ago
What is computer hacking? describe some examples
Naily [24]
Computer hacking<span> refers to the practice of modifying or altering </span>computer<span> software and hardware to accomplish a goal that is considered to be outside of the creator's original objective.
</span>
“bot,” is a computer under the control of a hacker <span>without the knowledge of the computer user.</span>

3 0
3 years ago
Other questions:
  • 2. What is the layout of the modern keyboard known as?
    13·1 answer
  • Number 20, can anyone help?
    11·1 answer
  • Phishing is a broad term that describes any program that is designed to cause harm or transmit information to others without the
    8·1 answer
  • When you're working with a word processing document and you press the DEL Key what happens
    7·2 answers
  • What was used to enhance silent films of the early 1900s
    15·1 answer
  • Mississippi law codes state that bullying and cyberbullying are against the law. A court can decide to incur ___________________
    10·1 answer
  • A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four organizations, Able, Baker, C
    11·1 answer
  • I have this questions i need to make it in a report format pages of atleast 3 pages and maximum of 5 pages​
    7·1 answer
  • James root lol ........................
    12·1 answer
  • Think about all the different ways you communicate with other people throughout your day. • What makes this communication succes
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!