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
Mavis is considering signing up for a hosted enterprise software solution for her small business. She recognizes that an advanta
babymother [125]

Since Mavis is considering signing up for a hosted enterprise software solution for her small business, an advantage of the software is <u>lower cost</u>.

A hosted enterprise software solution is typically hosted off-site and in a private server that is owned by a third party. It's vital for organizations as it can be used in managing daily business activities.

The advantages of a hosted software model include reliable backup, reduction in IT costs, scalability of computing resources, etc. It is also necessary for managing critical business processes.

Read related link on:

brainly.com/question/25526416

6 0
2 years ago
How useful is the creation of folders for your computer
aleksandr82 [10.1K]
Depends on your operating system. For any system not Chrome OS, folder creation is an organizational must. Your hard drive stores data sequentially in the form of bits. Whenever you want to access information on your hard drive, the drive has to, much like an array in programming, run through all the data until it comes across the desired file. This, as you could probably imagine, is cumbersome. We, as the users, have the luxury of not having to deal with that kind of information acquisition. We can create folders and directories into which we can place files. The reason I mentioned Chrome OS earlier, was because Chrome OS stores just about everything in the cloud. There isn't any real need to create directories on a Chrome system because all of that data can be managed and stored on Google's servers, as opposed to in files and organized by yourself.
5 0
3 years ago
Connected contacts require___ to open.
wariber [46]
Manual power





hope it helps you
6 0
3 years ago
What is software that helps a computer operate efficiently and keeps track of data on a computer?
Allisa [31]
<span>the answer is an operating system</span>
7 0
3 years ago
Can Someone help plz?
Ugo [173]

Answer:

i dont understand sorry

Explanation:

7 0
3 years ago
Other questions:
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    11·2 answers
  • Write a program that asks the user to enter two dates (in YYYY-MM-DD format), and then prints which date is earlier. Your progra
    15·1 answer
  • Chevening is looking for individuals with strong professional relationship building skills, who will engage with the Chevening c
    15·1 answer
  • Dallas is an analyst at an online retailer. He is great at creating representative diagrams showing the relationships between cu
    12·1 answer
  • Why did Simon bring Michael home?​
    9·2 answers
  • How do governments correct for negative externalities?
    5·1 answer
  • Three reasons Why we connect speakers to computers
    15·2 answers
  • What is one of four key principles of Responsible AIntelligence (AI) vendor serviceIntelligence (AI) vendor serviceI
    7·1 answer
  • Write the simplest statement that prints the following: 3 2 1 Go! python
    6·1 answer
  • What is one way object-oriented programming differs from procedural programming?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!