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
Together with some anthropologists, you’re studying a sparsely populated region of a rainforest, where 50 farmers live along a 5
Varvara68 [4.7K]

Answer:

Explanation:

Farmers are always both directly and indirectly connected to each other

Their network is mostly strong

Networks become weak only on the edges (ends) of the river but doesn't completely dimnish

With the available network length, the center of river bank forms the strongest network of all and becomes a key player in defining the balance property of overall network

The network is very well structurally balanced and we can see that through the below image

20 miles 10 20 30 40 50

See attachment file for diagram

Considering the total length of river as 50miles and and the center of the whole length will be at 25th mile. From that point, if we consider a farmer will be be having friends for a length of 20miles both along upstream and downstream.

By this he'll be in friend with people who are around 80% of the total population. As me move from this point the integrity increases and this results in a highly balanced structural network.

6 0
3 years ago
Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
Zolol [24]

Answer:

Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within main(), it calls a function called printIt() and passes the income value to printIt().

Explanation:

You will write a flowchart, and C code for a program that does the following:1. Within main(), it asks for the user’s annual income.2. Within main(), it calls a function called printIt() and passes the income value to printIt().  3. The printIt() function evaluates the income, and if the number is over 90000, prints a congratulatory message.  If the income is not over 90000, it prints a message of encouragement, like “You WILL make $50,000, if you keep going.”Here is what the output looks like.File SubmissionUpload your Flowgorithm file, your .c file, and a screen shot of your code output saved in a Word document including the path name directory at the top of the screen into the dropbox for grading.

8 0
3 years ago
Which EMC product provides a solution for block-level storage virtualization and data mobility?
LuckyWell [14K]
The answer is <span>VPLEX.</span>
3 0
3 years ago
Create a Word document or text file named Part3 that contains answers to the following:
Gnoma [55]

Answer:

11111

Explanation:

4 0
3 years ago
I paid $23.99 to subscribe for the “no adds” version.. its now been a week since then but today I’m shown adds and advertisement
Aliun [14]

contact the staffs or  it's a weekly paid item

8 0
3 years ago
Other questions:
  • The hot wires in a service entrance panel are most likely to be covered with ________ insulation. A. red B. green C. gray D. whi
    14·1 answer
  • What are midi signals
    12·2 answers
  • List three components of a computer system​
    10·1 answer
  • Which categories format cells
    14·2 answers
  • What limited the possibilities of game development from a technical viewpoint?
    7·1 answer
  • On her last performance review, beverly's boss commented that she needs to help out her co-workers when they are busy in order t
    5·2 answers
  • Which attribute defines the file name for the specific image in an image tag??
    13·1 answer
  • Which option is the default when creating appointments and meetings in a user’s own calendar as it relates to Free/Busy informat
    8·1 answer
  • You decided to upgrade your PC with a faster processor. To do this, you ordered a new motherboard over the Internet that support
    10·1 answer
  • _____is detection of events within a given set of parameters, such as within a given time period or outside a given time period.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!