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
Don't click on this I am testing
Andrew [12]

Don't click on this I am testing... I want the points so.

3 0
2 years ago
Read 2 more answers
Scientific Notation
Andrej [43]
To put a number in scientific notation, you must simplify it to become a number between 1-10 and multiply it by 10 up to the number of spaces the decimal was moved to simplify the number.

For example, to put the number .000000000006789 in scientific notation, you must move the decimal 12 times ( I think) to make the number 6.789 x -10up to the 12, be cause you have to move the decimal backwards.

To do another, 0.1 in scientific notation becomes 1 x 10up to the 1.

4 doesn't need to be in scientific notation, as it is already a number between 1-10. However, if you were to do it, it would become 4 x 10up to the 0.

For one more example, 78000000000000000 in scientific notation becomes 7.8 x 10up to the 15.

And so on for the rest. I hope this helps!
4 0
3 years ago
How do you solve this.
patriot [66]
Right click and it should give u a option to be able to edit then right the code then right click again and save and ur done
3 0
3 years ago
How do you write java
pantera1 [17]
Https://www.google.com/amp/m.wikihow.com/Write-Your-First-Program-in-Java%3Famp%3D1
7 0
3 years ago
The coding system that has just two characters is called:
cupoosta [38]

Answer:

A. Binary

Definition:

Pertaining to a number system that has just two unique digits 0 and 1. - binary code

6 0
2 years ago
Read 2 more answers
Other questions:
  • How does an employer judge a candidate?<br> The employer judge's the candidate's ? for a job.
    12·1 answer
  • Litmus-type test strips are used to test coolant for freeze protection and ?
    12·1 answer
  • Hackers who gain control over several computers can organize them into a client-server network known as a(n) __________ . This n
    7·1 answer
  • In file hashing, a file is read by a special algorithm that uses the value of the bits in the file to compute a single number ca
    13·1 answer
  • When you're working with a word processing document and you press the del key, what happens?
    6·2 answers
  • Word can store a maximum of how many documents in its Recent Documents area? five ten fifteen twenty
    8·1 answer
  • Whose job is it to ensure that a group stays focused and on schedule?
    8·1 answer
  • Any one know??please let me know
    15·2 answers
  • A computer is assigned an IP address of 169.254.33.16. What can be said about the computer, based on the assigned address?
    9·1 answer
  • Identify the parts of it, Give at least three web browser that you usually used to visit a website.​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!