subject

Prompt the user to enter a string of their choosing. output the string. (1 pt) ex: enter a sentence or phrase: the only thing we have to fear is fear itself. you entered: the only thing we have to fear is fear itself.(2) complete the getnumofcharacters() function, which returns the number of characters in the user's string. we encourage you to use a for loop in this function. (2 pts)(3) in call the getnumofcharacters() function and then output the returned result. (1 pt)(4) implement the outputwithoutwhitespace() function. outputwithoutwhitespace() outputs the string's characters except for whitespace (spaces, tabs). note: a tab is '\t'. call the outputwithoutwhitespace() function in (2 pts) ex: enter a sentence or phrase: the only thing we have to fear is fear itself. you entered: the only thing we have to fear is fear itself. number of characters: 46 string with no whitespace: .' c++ c++ c++ is what i have so far: #include #include using namespace std; //returns the number of characters in usrstrint getnumofcharacters(int usrstr) {usercount = usrstr. length(); return usercount; }const outputwithoutwhitespaces(string& ; usrstr) {string text; text = text. replace(" ",""); return text; }int main() {string usrstr; cout < < "enter a sentence or phrase: "; getline(cin, usrstr); cout < < "you entered: " < < usrstr < < endl; int count = getnumofcharacters(); cout < < "number of characters: " < < count < < endl; cout < < "string with no whitespace: " < < outputwithoutwhitespace() < < endl; return 0; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 23.06.2019 07:10
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
You know the right answer?
Prompt the user to enter a string of their choosing. output the string. (1 pt) ex: enter a sentence...
Questions
question
Mathematics, 29.01.2020 08:51
question
Mathematics, 29.01.2020 08:51
question
Mathematics, 29.01.2020 08:51