Question: Write a C + + program that will collapse a sentence into less characters, but make sure it is still readable Prompt the user for
Write a C program that will collapse a sentence into less characters, but make sure it is still readable
Prompt the user for a line of input
Remove all commas, periods, question marks, and double quotes
Remove all spaces and tabs While the whitespace is being removed, capitalize the first character after the whitespace
Make sure that your program works properly for multiple spacestabs at the beginning of the line, between the words, and at the end of the line
Output the final line between a set of parentheses, and
REQUIREMENTS:
You may NOT use arrays or vectors in this program, only string, integral such as int and bool data types
You may ONLY use the string functions from the chapter. You may NOT use other string functions. For example, you may NOT use the operator to add to a string.
strVar.atindex
strVarindex
strVar.appendn ch
strVar.appendstr
strVar.clear
strVar.comparestr
strVar.empty
strVar.erase
strVar.erasepos n
strVar.findstr
strVar.findstr pos;
strVar.findfirstofstr pos
strVar.findfirstnotofstr pos
strVar.insertpos n ch;
strVar.insertpos str;
strVar.length
strVar.replacepos n str;
strVar.substrpos len
strVar.size
strVar.swapstr
Sample Run #bold underlined text is what the user types:
Line? this is C class numbered
thisIsCClassNumbered
Test # checks all output
Mini Test # output includes "thisIsC" for first few words
Mini Test # output includes CClass" for middle words
Sample Run #bold underlined text is what the user types:
Line? more and Here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
