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
lbvjy [14]
3 years ago
14

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

at.", 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.


#include


#include


using namespace std;


int main() {


string userInput;


getline(cin, userInput);


int isPresent = userInput.find("darn");


if (isPresent > 0){


cout << "Censored" << endl; /* Your solution goes here */


return 0;


}
Computers and Technology
1 answer:
Alisiya [41]3 years ago
8 0

Answer:

The Java code is given below

Explanation:

import java.util.*;

public class CensoredWords {

public static void main(String args[]) {

Scanner scnr=new Scanner(System.in);

String userInput;

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

userInput=scnr.nextLine();

int res=userInput.indexOf("darn");

if(res == - 1) {

System.out.println(userInput);

} else {

System.out.println("Censored");

}

}

}

You might be interested in
Spanning Tree Protocol (STP) is a loop-prevention mechanism used in modern networks. STP is, however, vulnerable to misconfigura
maks197457 [2]

Answer:

Any of the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

Explanation:

Given that STP an acronym of Spanning Tree Protocol, and its major purpose is to stop the bridge loops and the broadcast radiation that emanates from its topology.

Cisco carried out three instruments or tools to protect the STP topology. These protection tools accompany the STP, and they are the following:

1. Root Guard

2. BPDU Guard

3. BPDU Filtering

3 0
3 years ago
Signs of mastery include?
katrin2010 [14]
1. You know it. Self-explanatory.
2. You know you know it. This means you didn’t guess or get lucky, or answer with a question mark in your voice.
3. You know it quickly, independently and efficiently.
- Quickly means you have this skill ready, with no playing around in order to figure it out. While it is an invaluable skill to be able to figure out a math problem, what we’re going for with our basic skill list is FLUENCY, meaning you’re past the figuring it out phase and your ability is more automatic. A very simple example of this would be: for the basic subtraction problem 11-9, figuring it out would mean counting up from 9 to 11 (either on your fingers or in your head) to get 2. Automaticity, on the other hand, would mean looking at 11-9 and knowing the answer is 2, as if it were a sight word. The processing speed is so fast that there may as well be no processing involved. It’s that automatic. At every new level of math, there is a whole new layer of skills that we want at this ‘automatic’ level, freeing the brain up to do it’s ‘figuring out’ with the next level.
- Independently means with ZERO help, no reminders & no hints.
- Efficiently. An example of doing a skill the most efficient way is simplifying fractions before multiplying them, rather than multiplying first, then simplifying.
4. You know it cold. Three months can go by without you actively practicing it, and you STILL know it. This is perhaps the most important criteria, and often the most overlooked.
4 0
3 years ago
Differentiate between native and hybrid apps​
patriot [66]
Basically, a hybrid app is a web app built using HTML5 and JavaScript, wrapped in a native container which loads most of the information on the page as the user navigates through the application (Native apps instead download most of the content when the user first installs the The native applications are created for a particular platform either Android or iOS, whereas the hybrid development process relies on cross-platform functioning. ... The developers deal with one core code that covers both platforms. Therefore the development process is the main difference between native and hybrid apps.

Pls mark me as brainliest :)
6 0
3 years ago
A company's ____________ is the percentage of the total target market for the product that belongs to the company.
grigory [225]

a companys Market share is the percentage of the total target market for the product that belongs to the company

3 0
4 years ago
Which type of free software contains embedded marketing material within the program?
Reika [66]
Adware is the answer
7 0
3 years ago
Other questions:
  • Cattell classified projective tests, such as the rorschach inkblot test, as:
    13·1 answer
  • Write a main function to do the following: A. Declare an array of 20 strings. B. Create an input file for the file "poem.dat". C
    12·1 answer
  • Which features should a study schedule include? Check all that apply.
    15·2 answers
  • Define some everyday if else statements you use to determine action. What are the branches of your statement?
    12·1 answer
  • Examine the efficiency the various recovery algorithms used in deadlock handling
    10·1 answer
  • Your roommate has been hogging the bandwidth on your router lately. What feature should you configure on the router to limit the
    13·1 answer
  • Write a program to input a number and check whether it is even or odd number
    7·1 answer
  • Consider a file/directory with the following info:
    14·1 answer
  • Why is computer called and information processing machine​
    6·1 answer
  • The _____ feature enables you to represent text as colorful visuals.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!