Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write a C++ program based on the following instructions. Thank you!! roblem description Write the following functions as prototyped below. Do not alter the
Please write a C++ program based on the following instructions. Thank you!!
roblem description Write the following functions as prototyped below. Do not alter the function signatures. Demonstrate each function using literal strings defined in your client program (e.g., don't prompt the user for test inputs) /// Returns a copy of the string with its first character capitalized //I 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. std:: string center(const std: : string& str, size_t width, char fiuchar- '); /// Returns a copy of the string left justified 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. Enmpte:njustenietio worlar, 20, ") returns Hetlo vorla std::string ljust(const std::string& str, size t width, char fillchar // Returns a copy of the string with all the uppercase letters converted /// to lowercase. /// Example: lower("HELLO WORLD") returns "hello world std::string lower(const std::string& str) /// Returns a copy of the string with leading characters removed. The /11 chars' argument is a string specifying the set of characters to be removed. // If omitted, the 'chars' argument defaults to removing whitespace. The chars argument is not a prefix; rather, all combinations of its value 1// are stripped. // Example: strip("spacious returns "spacious /Example: Istrip("www.example.com","cmowz.") returns "example.com std:: string Istrip(const std: : string& str, const std: : string& chars \t \v\f "); = /// Returns a copy of the string right-justified in a string of length 'width'. /// Padding is done using the specified 'fillchar (default is an ASCII space) 1/ The original string is returned if 'width' is less than or equal to the /// string's length. roblem description Write the following functions as prototyped below. Do not alter the function signatures. Demonstrate each function using literal strings defined in your client program (e.g., don't prompt the user for test inputs) /// Returns a copy of the string with its first character capitalized //I 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. std:: string center(const std: : string& str, size_t width, char fiuchar- '); /// Returns a copy of the string left justified 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. Enmpte:njustenietio worlar, 20, ") returns Hetlo vorla std::string ljust(const std::string& str, size t width, char fillchar // Returns a copy of the string with all the uppercase letters converted /// to lowercase. /// Example: lower("HELLO WORLD") returns "hello world std::string lower(const std::string& str) /// Returns a copy of the string with leading characters removed. The /11 chars' argument is a string specifying the set of characters to be removed. // If omitted, the 'chars' argument defaults to removing whitespace. The chars argument is not a prefix; rather, all combinations of its value 1// are stripped. // Example: strip("spacious returns "spacious /Example: Istrip("www.example.com","cmowz.") returns "example.com std:: string Istrip(const std: : string& str, const std: : string& chars \t \v\f "); = /// Returns a copy of the string right-justified in a string of length 'width'. /// Padding is done using the specified 'fillchar (default is an ASCII space) 1/ The original string is returned if 'width' is less than or equal to the /// string's length Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started