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
PLZZZ HELP!!!
kifflom [539]

Answer:

D the answer is D or c one of those 2

3 0
3 years ago
How can you have a safe browser experience
goldfiish [28.3K]

Most likely the answer is to delete cookies, as it cuts down on the amount of tracking sites can do to you.

6 0
2 years ago
Implemente a função ao lado, que recebe um preço e um booleano indicando se já está com desconto ou não. Se o preço for maior qu
Andrew [12]

Answer:

function pecoDesconto(preco, estaComDesconto) {

 

 let p = preco;

 let desconto = estaComDesconto;

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

 }else{

   return "Negócio fechado";

 }

}

Explanation:

function pecoDesconto(preco, estaComDesconto) {

 

 // Implemente a função ao lado, que recebe um preço//

 let p = preco;

// variavel que indica desconco//

 let desconto = estaComDesconto;

//Se o preço for maior que 100 e não estiver com desconto, a função deve retornar Quero pechinchar.//

 if(p > 100 && desconto == false){

   return "Quero pechinchar";

   //Caso contrário, deve retornar Negócio fechado

 }else{

   return "Negócio fechado"

 }

}

só te faltou ler com atenção, e um pouco de logica!

7 0
2 years ago
Which of these is a way that a doctor can examine a patient?
SIZIF [17.4K]

Answer:

D. all the above

Explanation:

because doctor uses stethoscope to listen patients heart, he also used hammer to check patients reflexes and also doctor has to listen to the patient.

5 0
3 years ago
What console can be used to enable disable start or stop a service
umka21 [38]
That would be msconfig!
5 0
2 years ago
Other questions:
  • What device brocasts all data packets to other nodes on a network?
    5·1 answer
  • Suppose your company has decided that it needs to make certain busy servers faster. Processes in the workload spend 60% of their
    5·1 answer
  • Which of the following statements is false?
    10·1 answer
  • How much does a Canon PowerShot G7X cost in America?
    14·1 answer
  • Java provides a(n) ____ class, which contains many useful methods for manipulating arrays.
    5·1 answer
  • Literally no one helps answer my questions so this website is pointless.... : /
    11·1 answer
  • Which three techniques are used in this photo
    12·1 answer
  • What is the extension of a Microsoft access database 2013​
    7·2 answers
  • 1. You are given a database to create, however, you realize that in the instructions you are told to create relationships betwee
    5·1 answer
  • A user calls to complain that her computer is behaving erratically. Some days it functions correctly, and other days, it crashes
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!