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
Power point how to insert diamond symbol
IceJOKER [234]
You got to "insert" and then you go to "shapes" and then you find the symbol you like and you drag and drop it onto the page. Then you can resize to the size and angle you would like it at.
4 0
3 years ago
What do TCP/IP MEAN​
melomori [17]

Answer:IP is internet protocol, every router has one some routers are dynamic which means they change everything the router reboots and some routers are static which means you would have to call your isp(Internet Service Provider) to get it changed.

Explanation: I do illegal things :)

8 0
3 years ago
If a large organization wants software that will benefit the entire organization—what's known as enterprise application software
Ganezh [65]

The organization must develop it specifically for the business in order to get the functionality required is True.

a) true

<u>Explanation:</u>

In software development industry it called as EAS. Where organizations required complete one solution and made most customizable with less cost effective.

Moreover to implement the same organizations has to spend less money for software development and hardware appliances. An organization has clear documented which specific their business requirements and their business future expansion.

Basically in organization from low grade employee to higher employee and meeting is arranged and understand system requirements and compiled as document which is circulated to higher official in organization for their final approval.

5 0
3 years ago
Asking questions when something is unclear is part of
Ksenya-84 [330]
Personally responsibility

Hope this helps
6 0
3 years ago
Write a C++ programthat reads in the side of a square and prints out a pattern on$
AnnZ [28]

Answer:

#include<iostream>

using namespace std;

//main function

int main(){

   //initialize the variables

   int side;

   //print the message

   cout<<"Please enter the side of square: ";

   cin>>side;  //read the vale and store in the variable.

   // for loop

   for(int i=1;i<=side;i++){  //lop for rows

       for(int j=1;j<=side;j++){   //loop for column

           cout<<"$";  //print the '*'

       }

       cout<<endl;

   }

}

Explanation:

Create the main function and declare the variable side.

print the message on the screen for the user and then store value enter by the user on the variable side.

take the nested for loop for print the pattern.

nested for loop means, loop inside another loop it is used for print the pattern having rows and columns.

the first loop updates the row number and the second the loop print the character '$' in the column-wise.

in the code,

if i = 1, for loop check the condition 1 <= 5 if the value of side is assume 5.

condition is true and the program moves to the second for loop and starts to print the character '$' five times after that, print the new line.

then, the above process repeat for different rows and finally, we get the pattern in square shape.

7 0
3 years ago
Other questions:
  • Stefan is finalizing his presentation by adding media files and preparing it for distribution. Stefan knows that saving a presen
    13·1 answer
  • Identical objects are placed in Beaker A and in Beaker B. The objects float as shown in the diagrams below. What can you conclud
    9·1 answer
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • Which of the following is a non timber forest product
    7·1 answer
  • PowerPoint provides a wide variety of predefined shapes that can add visual insert to a slide true or false
    10·2 answers
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • What is the name of the virus that appears to be a legitimate program but when opened
    9·1 answer
  • __________ contain(s) remnants of word processing documents, e-mails, Internet browsing activity, database entries, and almost a
    9·1 answer
  • Cash cows are always in
    7·1 answer
  • Question #3
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!