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
ale4655 [162]
3 years ago
5

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:CensoredEx: 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:
barxatty [35]3 years ago
6 0

Answer:

#include <string>

#include <iostream>

using namespace std;

int main() {

string userInput;

getline(cin, userInput);

// Here, an integer variable is declared to find that the user entered string consist of word darn or not

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

if (isPresent > 0){

cout << "Censored" << endl;

// Solution starts here

else

{

cout << userInput << endl;

}

// End of solution

return 0;

}

// End of Program

The proposed solution added an else statement to the code

This will enable the program to print the userInput if userInput doesn't contain the word darn

You might be interested in
As asda ddg dfgd fgd dfgd dfgsdf
Jet001 [13]

as asds ddg dfgd fgd dfgd dfgsdf to you too

6 0
3 years ago
Read 2 more answers
Which type of USB connector is always plugged into the computer to connect an external device?
ycow [4]
The answer is a micro usb
7 0
4 years ago
Read 2 more answers
He labeled regions in a document that serve as placeholders for specific types of information.
dem82 [27]

Answer:

specific types of information.  Sounds controlled :)

Explanation:

8 0
3 years ago
War Driving is the act of moving around a specific area, mapping the population of wireless access points for statistical purpos
serg [7]

Answer:

gjf

Explanation:

knlo

6 0
3 years ago
QUESTION 2 of 10: New shoes are on SALE. You find a pair you like for $85 dollars. But you only have $45 with you. So, you pay $
wariber [46]

Answer:

The balance amount owned in six months is $ 46.8

Explanation:

Given as :

The price of new shoes = $85

The amount paid for the shoes  = $ 40

The balance amount for the shoes = $85 - $40 = $ 45

The rate of interest = 8%  

the time period = 6 months = 0.5 years

<u>From simple method</u>

Simple interest = (\frac{\textrm principal\times \textrm rate \times \textrm time}{100})

or, Simple interest = (\frac{\textrm 45\times \textrm 8 \times \textrm 0.5}{100})

Or, Simple interest = \frac{180}{100} = $1.8

So, Amount = Principal + Interest

or, Amount = $45 + $1.8 = $ 46.8

Hence The balance amount owned in six months is $ 46.8   Answer

6 0
3 years ago
Other questions:
  • __________ involves analyzing a large amount of data to extract knowledge and insight
    13·1 answer
  • In the Budget Details sheet, if you wish to autofill with the formula, you must use a ______ reference for the LY Spend Total ce
    10·1 answer
  • Declare k, d, and s so that they can store an integer, a real number, and a small word (under 10 characters). Use these variable
    13·1 answer
  • What option is used to combine several objects so that they can be treated as a single unit
    6·1 answer
  • A computer lab has two printers. Printer I handles 40% of all the jobs. Its printing time is Exponential with the mean of 2 minu
    8·1 answer
  • Packet switching was invented by: <br> Apple <br> DARPA <br> Google <br> Microsoft
    13·1 answer
  • An eco-friendly home-building company has asked you to create their logo. Which of the following color schemes would work best t
    10·1 answer
  • You are required to write a calculator for Geometric shapes(Circle, Square, and Rectangle). The basic idea is that you willprovi
    7·1 answer
  • If you have $35 in your checking account and swipe your debit card for a $50 purchase WITH overdraft protection, what most likel
    10·1 answer
  • Engineers use science to ______ things that people use.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!