Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language is C++ program 1 Write a function removeSpace that takes one string argument (by value), removes spaces from this string using stringstream, and returns

language is C++

program 1

Write a function removeSpace that takes one string argument (by value), removes spaces from this string using stringstream, and returns the resulting string. Write a main program to test your function. Your main program should:

- prompt the user to enter a string string1

- call the function removeSpace and send string1 as argument

- print the new string value.

Sample run:

Please enter a phrase: Welcome to CS211, let the fun begin

The resulting phrase is: WelcometoCS211,letthefunbegin

Program 2

Rewrite the function removeSpace from program 1 that removes spaces from this string using stringstream. The function is now a void function that takes one string argument by reference. Write a main program to test your function. Your main program should:

- prompt the user to enter a string string1

- call the function removeSpace and send string1 as argument

- print the new string value (in main not in the function).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

7-2 What are the different types of networks?

Answered: 1 week ago