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
How many nibbles make one kilobyte​
Kazeer [188]
2000 nibbles I think correct me if I’m wrong
5 0
3 years ago
Read 2 more answers
When admitting digital evidence at trial, the issue of ________ comes up when the evidence involves computer-generated records.
kari74 [83]

Answer:

When admitting digital evidence at trial, the issue of <u>Authenticity</u> comes up when the evidence involves computer-generated records.

Explanation:

The digital evidence such as video, audio or some pictures have been presented before court as evidence. The first question that may arise is related to "authenticity of the material". To authenticate that evidence court may order the forensic audit of that particular evidence.

<em>So, the issue of authenticity of evidence will arise, in case of digital evidence.</em>

5 0
3 years ago
HELP I WILL GIVVE BRAINLY AND 15 POINTS
levacccp [35]

Answer:

Because someone was hittting the space bar in the message instead of typing letters and numbers

Explanation:

Because they were bored or it was a glitch

4 0
3 years ago
A digital footprint is .
BlackZzzverrR [31]

Your digital footprint is the trail of 'electronic breadcrumbs' you leave behind when you use the internet. It can include the websites you visit, the photos you upload and your interactions with other people on social networks.

3 0
3 years ago
A developer designed a process in UiPath Studio that is best-suited for a simple and linear process. Which Studio workflow type
Gala2k [10]

Question options:

State Machine

Flowchart

Sequence

Global Exception Handler

Answer:

Sequence

Explanation:

Uipath is an RPA(Robotic process automation) software that is used by IT professionals and business executives in automating routine or iterative tasks in an organization. Uipath process projects incorporate different workflow types which include :sequence, flowchart, state machine and global exception handler. The sequence workflow type is used for simple linear projects that are not very complex and occupies a single activity block.

3 0
3 years ago
Other questions:
  • But this time use 16 kib pages instead of 4 kib pages. what would be some of the advantages of having a larger page size? what a
    11·1 answer
  • What feature new to Windows Server 2012 provides the ability to find identical sets of data on a SAN based storage array and red
    14·1 answer
  • Sally thought of adding a new paragraph after the
    6·1 answer
  • The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
    15·1 answer
  • Differentiate Between register and Memory location (
    13·1 answer
  • State two function of protein in the body
    8·1 answer
  • ITS A VOTE I NEED HELP
    12·1 answer
  • 19 dollar fortnite gift card
    14·2 answers
  • Pls help will give brainlest!!! The image shows a line graph. Which scientist is most likely to use this visual aid in a present
    15·1 answer
  • A serial schedule:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!