Thanks to it being the flu season, I missed my programming class today. Our teacher posted an assignment online that is due in the next 2 hours and I need help.
This is the assignment:
#include <iostream>
#include <string>
using namespace std;
// call the other 3 (or 4 if extra credit) funcs,
// so f( "CS 1505 Pierce College" ) returns
// "cs####pIERCEcOLLEGE" (full credit)
// "cs####pIERCEcOLEGE" (extra credit), or
// "cs#pIERCEcOLEGE" (extra credit)
string f(const string & s);
// e.g. removeSpaces( "The black dog" ) returns "Theblackdog"
string removeSpaces(const string & s);
// change case of letters, leave other chars unchanged
// e.g. changeCase( "Blah123" ) returns "bLAH123"
string changeCase(const string & s);
// replace digits with #'s
// e.g. redactDigits( "4 pizzas and 87 beers" )
// returns "# pizzas and ## beers"
string redactDigits(const string & s);
// extra credit
// replace consecutive occurrences of the same char
// with a single occurrence
// e.g. removeRepetitions( "Molly greeted 11112 guests" )
// returns "Moly greted 12 guests"
string removeRepetions(const string & s);
int main() {
}
I obviously don't want direct answered but I would LOVE some direction.
I understand that I need to refer to the string(whether its f, changecase, removeRepetions etc) in my main function and then I also need to do their declaration/definition after the main function. Where do I start?
Okay, I got the removeSpaces function to work but am having troubles with this one now. I can't seem to get it to read more than just 1 letter. Please someone help!