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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, magicalunicorns47
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
image
Computers and Technology, 23.06.2019 03:00, minelly1717
Your business be in google top rank. more the rank more the business leads. for best seo and digital marketing services be confident to contact you can get best seo solutions by assistance experts provide digital marketing, website development, seo expert services and social media internet seo expert services your branding solutions. seo expert services ,best seo expert services, online seo expert services,
Answers: 3
image
Computers and Technology, 24.06.2019 03:30, live4dramaoy0yf9
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
image
Computers and Technology, 24.06.2019 22:00, yilianblanco
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
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 in other subjects: