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
Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
pychu [463]
Im pretty sure that is false
5 0
2 years ago
Read the following scenario what type of business letter do you think is required in this situation?
grandymaker [24]

Answer:

Cover letter

Explanation:

The type of business letter Melissa and Melrose would need to write is a Cover letter.

The Cover Letter is usually not more than a page document which gives a kind of summary or hint about who individual is and the quality of the individual, while highlighting why an individual is the best fit for the role they are seeking for.

Most recruiters usually make use of the cover letter, as a first hurdle, to screen out applicants especially when applications are much.

Melissa and Melrose, in addition to the resume they would submit for the volunteering job, would need a cover letter.

8 0
3 years ago
Read 2 more answers
Can someone write me a design brief about a stadium​
Delicious77 [7]

Btw..which dtadium do u want cricket or football!?

3 0
2 years ago
Read 2 more answers
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
What is a distinguishing feature of 5G mm Wave?
RoseWind [281]

Answer: 5G high bands (mmWave, also referred to as FR2) are found in the range of 24GHz to 40GHz. They deliver large quantities of spectrum and capacity over the shortest distances

4 0
2 years ago
Other questions:
  • . What may happen if a large number of computer users are attempting to access a Web site at the same
    10·2 answers
  • What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
    13·1 answer
  • A. experiment by purposely misconfiguring the gateway address on pc-a to 10.0.0.1. what happens when you try and ping from pc-b
    14·1 answer
  • discuss the benefits of normalization, and do you think we should normalize our designs to higher levels than 3NF? Why or why no
    9·1 answer
  • Which audio media can be directly sent to the subscribers through an RSS feed?
    6·1 answer
  • Write a method that accepts a string as an argument and checks it for proper capitalization and punctuation. The method should d
    14·1 answer
  • Select the correct answer from the drop-down menu.
    15·2 answers
  • A type of authentication that requires the user to provide something that they know, such
    6·1 answer
  • In two to three sentences, define "home row" and explain why it is important.
    6·2 answers
  • Is a device used to test the network connection.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!