Assignment: Write a C++ program that allows for processing strings.

Problem description

Write the following functions as prototyped below. Do not alter the function signatures.

/// Returns a copy of the string with its first character capitalized
/// and the rest lowercased.
/// @example capitalize("hELLO wORLD") returns "Hello world"
std::string capitalize(const std::string& str);
/// Returns a copy of the string centered in a string of length 'width'.
/// Padding is done using the specified 'fillchar' (default is an ASCII space).
/// The original string is returned if 'width' is less than or equal to the
/// string's length.
/// @example center("C++ is fun", 20, '*') becomes " *****C++ is fun*****"
std::string center(const std::string& str, size_t width, char fillchar = ' ');
/// Returns the number of vowels (a, e, i, o, u) in a string – case insensitive
/// @example numVowels("HEllo WorlD") returns 3
int numVowels (const std::string& str);
/// Returns a copy of the string with all the letters converted
/// to lowercase.
/// @example lower("heLLO WoRLD") returns "hello world"
std::string lower(const std::string& str);
/// Reverses the order of the characters in the string
/// @example reverse("ABCD") returns "EDCBA"
void reverse(std::string& str);
/// removes vowels from a string
/// @example removeVowels("Hello wOrld") returns "Hll wrld"
std::string removeVowels(std::string& str);
/// Returns the Scrabble(tm) word score for a string using the
/// point values shown in the table below:
///
/// +--------+------------------------------+
/// | Points | Letters |
/// +--------+------------------------------+
/// | 1 | A, E, I, L, N, O, R, S, T, U |
/// +--------+------------------------------+
/// | 2 | D, G |
/// +--------+------------------------------+
/// | 3 | B, C, M, P |
/// +--------+------------------------------+
/// | 4 | F, H, V, W, Y |
/// +--------+------------------------------+
/// | 5 | K |
/// +--------+------------------------------+
/// | 8 | J, X |
/// +--------+------------------------------+
/// | 10 | Q, Z |
/// +--------+------------------------------+
///
/// @example, the word "FARM" is worth 9 points in Scrabble: 4 for the 'F',
/// 1 each for the 'A' and the 'R', and 3 for the 'M'. The function ignores
/// any characters other than uppercase letters in computing the score.
int scrabble_score(const std::string& str);

Write a client program that tests each of the functions works as described. Hard-code test strings in your program, i.e., do not prompt the user for any input. The output should be labeled to easily see what function is being tested. (Hint: you may find it easier to write a separate test function for each of the functions you're testing.). Your tests should be based on the function specifications. Functions are tested by feeding them input and examining their output. The tests should demonstrate that the functions work as specified with a variety of inputs.

Requirements

Your functions should be declared and defined within the namespace "csutilities". In order to be compatible with other languages, define integer as an int using typedef statement and use integer where you normally use int for your data types.

Here is a sample run: Don't worry about duplication my exact output format for spaces after the colon.

capitalize("hELLO wORLD"): Hello world
center("C++ is fun"): *****C++ is fun*****
Number of vowles("HEllo WorlD"): 3
lower("hELLO wORLD"): hello world
reverse("Where am I!"): !I ma erehW
hELLO wORLD without vowels is: hll wrld
scrabble_score("FARM"): 9
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.