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 02:30
Your boss wants you to configure his laptop so that he can access the company network when he is on the road. you suggest a vpn connection to him. he is very concerned about security and asks you how secure vpn is. what do you tell him?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 05:20
Which operating system is a version of linux?
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
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, 25.01.2020 08:31
question
Mathematics, 25.01.2020 08:31
question
History, 25.01.2020 08:31
question
Physics, 25.01.2020 08:31
question
Mathematics, 25.01.2020 08:31
Questions on the website: 13722363