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]
2 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]2 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
Lonic compounds are also known as <br> a. salts <br> b. valence <br> c.organic <br> d.elements
shutvik [7]
I'm not quite sure but it maybe b
6 0
3 years ago
Read 2 more answers
What is the scope of each variable?
kari74 [83]

Answer:

scope of pet name is limited to pet class and color is accessible to the whole program

Explanation:

4 0
3 years ago
Read 2 more answers
P2p networks are most commonly used in home networks. <br> a. True <br> b. False
postnew [5]
<span>The statement that P2P networks are most commonly used in home networks is true. 
</span>P2P stands for peer-to-peer communication network. It is an example of local administration. <span> Two or more PCs share files and access to devices such as printers without requiring a separate server computer or server software with P2P type of network.</span>
6 0
3 years ago
In addition to compiling the list of user access requirements, applications, and systems, the BIA also includes processes that a
laila [671]

Answer:

automated

Explanation:

Basically a Business Impact Analysis (BIA) estimates and determines the effects of a business activity and process disturbances. These disruptions can be natural or electronic disasters. It also collects information which is used to establish recovery plan. It identifies the business vulnerabilities and works on the strategies in order to reduce such potential hazards. The BIA involves both manual and automated processes. BIA involves automated processes which include the automated software tools that enables the protection of the confidential information of the users and also generates automated reports about the critical business processes.

5 0
3 years ago
Which command group on the Slide Master tab is used to add headers, footers, and other placeholders to the slide
Vikki [24]

Answer:D

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • Which is the output of the formula =AND(12&gt;6;6&gt;3;3&gt;9)
    6·1 answer
  • What is a way to minimize technical problems with computer
    13·1 answer
  • What are the six critical components of an information system? Select three of the six components, and describe a potential vuln
    15·1 answer
  • Write a class named Car that has the following member variables: - yearModel. An int that holds the car’s year model. - make. A
    6·1 answer
  • Mary is writing an article about the software development life cycle. She wants to place a flowchart besides the text. Which men
    6·2 answers
  • 6. A distribution consists of three components with frequencies 200, 250 and 300 having means
    14·1 answer
  • The main parts of a lever are the....
    6·2 answers
  • A disciplined, creative, and effective approach to problem solving is needed for project success. The nine-step approach to prob
    13·1 answer
  • Why computer literacy is vital to access in business work
    7·1 answer
  • __________ is a Microsoft software development tool that developers can use to write multimedia applications
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!