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
Variables make it easier to do what?
defon
<span>D. Make changes to your code
Variables allow the ability to easily substitute numbers for other numbers.
</span>
8 0
3 years ago
An administrator has initiated the process of deploying changes from a sandbox to the production environment using the Force IDE
Pani-rosa [81]

Option A because the environment should be selected for which the changes are to be applied. In a time Force IDE has many project environments for example maybe a java project and C++ project would be there on sandbox, so the environment selection is important.

Option B because the related changed sets should be specified so that other developers that have access to the project can see the changes being made.

Option D The data fields that are needed to be deployed should also be provided so that the updated version can be seen by other developers.

Rejected Options :

Option C user name and password has nothing to do with the production environment because if the user has it only then it can come and make changes.

6 0
3 years ago
True or false? malware problems and other compromises of your computer information are rare.
Marina86 [1]
I think that is false I am not 100% sure.
3 0
3 years ago
What is a quasi vpn?
Natasha2012 [34]

Answer:

i don't think there is such thing as a quasi vpn

Explanation:

6 0
3 years ago
Jaboooo helloooo are u there
Fed [463]
?????????????????????
8 0
3 years ago
Read 2 more answers
Other questions:
  • A ________ is a set of programs that manipulate the data within a database.
    12·1 answer
  • If someone receives a shock, or a piece of equipment is throwing sparks or arcing you should try to pull them away from the sour
    7·1 answer
  • How does Hadoop work? It breaks up Big Data into multiple parts so each part can be processed and analyzed at the same time on o
    5·1 answer
  • What are some effective methods for scrolling? Check all that apply.
    6·1 answer
  • Some architectures support the ‘memory indirect’ addressing mode. Below is an example. In this case, the register R2contains a p
    8·1 answer
  • What should you include in a persuasive speech
    14·1 answer
  • What is a key function of a scrum master plato answer plz
    13·1 answer
  • A bubble starts by comparing the first item in the list to all the remaining items, and swaps where the first item is ____ a lat
    9·2 answers
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • Write if true or false
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!