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
Galina-37 [17]
3 years ago
9

Print "Censored" if userInput contains the word "darn", else print userInput. End with a newline. Ex: If userInput is "That darn

cat.", then output is: Censored Ex: If userInput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has 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);
/* Your solution goes here */
return 0;
}
Computers and Technology
1 answer:
Gemiola [76]3 years ago
6 0

Answer:

<em>The program goes as follows</em>

<em>Comments are used to explain difficult lines</em>

#include <iostream>

#include <string>

using namespace std;

int main()

{

string userinput;

getline(cin,userinput);

/* My Solution starts here*/

//Initialize sub string position to 0

int stringpos = 0;

// Declare an iterating variable to iterate through userinput

int startpos;  

//Declare and initialize a determinant variable

int k = 0;

while((startpos = userinput.find("darn",stringpos))!=string::npos)

{

 //If userinput contaings "darn", increase k by 1

k++;

// Go to next string position

stringpos = startpos+1;  

}

//If determinant variable k is p then, userinput does not contain "darn"

if(k==0)

{

 cout<<userinput;

}

//Otherwise, it contains "darn"

else

{

 cout<<"Censored";

}

/* My Solution ends here*/

return 0;

}

See attached for .cpp program file

Download cpp
You might be interested in
Decision making process
Zanzabum
Choice is the answer you want 
7 0
3 years ago
A ---------------- enable an organization to use cloud computing technology as a means of centralizing access to IT resources by
sp2606 [1]

Answer: Private cloud

Explanation:

In a private cloud it is owned by the organization and its cloud computing technology is utilized by its various departments as a centralized access to its IT resources. Here the authority of the cloud lies entirely to the organization.

7 0
3 years ago
Under what category of programs and apps do databases and enterprise computing fall?
Evgesh-ka [11]
Answer is productivity

Sometimes called the office or personal productivity software, productivity software is dedicated to producing databases, spreadsheets, charts, graphs, documents, graphs, digital video and worksheets. Reason behind the name productivity is due to the fact that it increases productivity in office work.

6 0
3 years ago
The command prompt is currently in the Old_Data folder. Which two commands can you use to create a new folder called Archive?
Ksivusya [100]

Answer:

mkdir Archive

Explanation:

Assuming that you want to create the new folder within the Old_Data folder then you would only need one command which is the mkdir command. This will create the folder inside the current location which in this case is the Old_Data folder. Like so...

mkdir Archive

Otherwise, you would first need to navigate to the folder that you want to create the new folder. You do this using the "cd /" to navigate to previouse directory and then to the one you want.

7 0
3 years ago
Ground beef, pork, or other meats should be cooked to what minimum internal temperature?​
hoa [83]
160 Fahrenheit or 71.1 Celsius depending on which one you use
8 0
4 years ago
Read 2 more answers
Other questions:
  • Which is the largest unit of measurement for computer data?
    14·1 answer
  • How is the EF​ computed? A. ES​ + Activity time B. LF minusActivity time C. ​Min{LS of all immediate following​ activities} D. ​
    11·1 answer
  • One of the Employee responsibilities to LOTO is:
    5·1 answer
  • When would you use a template when working with word 2013?
    15·1 answer
  • The following are the CPU and I/O behavior of three processes, timings in seconds.
    9·1 answer
  • Programs which were typically reserved for college-level classes such as computer animation and CAD programs are now being appli
    13·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
  • You are an IT manager at Gigantic Life Insurance. You have a new desktop support person starting today whose experience is limit
    10·1 answer
  • Assignment 2: room area <br>programming python in Project Stem​
    8·1 answer
  • In your opinion., which Zelda character is the hottest? Be honest.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!