Question: Implement the following functions, lab0903 provided /* Using a for loop, process a passed in string return a new string as such [firstchar][lastchar][firstchar-1][lastchar-1]...[firstchar-n][lastchar-n] */ string
Implement the following functions, lab0903 provided /* Using a for loop, process a passed in string return a new string as such [firstchar][lastchar][firstchar-1][lastchar-1]...[firstchar-n][lastchar-n] */ string oddifyString(const string& ); /* Use a for loop to return the sum of squares sumsquares = 12 + 22 + 32 = k=1 n k 2 */ unsigned long sumsquares( unsigned long ); Output: IsnednioaJ JaoindensI 14
#include#include using namespace std; /* Using a for loop, process a passed in string return a new string as such [firstchar][lastchar][firstchar-1][lastchar-1]...[firstchar-n][lastchar-n] */ string oddifyString(const string& ); /* Use a for loop to return the sum of squares 1^2..n^2 * */ unsigned long sumsquares( unsigned long ); int main() { string moviechar="India Jones"; cout << oddifyString(moviechar) << endl; cout << sumsquares(3) << endl; return 0; } //Implement functions here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
