Question: plz give some explnations. 3. Programming Collections (a) [3] Write a function called capitalize that takes as a parameter a string and capital izes the
plz give some explnations.
3. Programming Collections (a) [3] Write a function called capitalize that takes as a parameter a string and capital izes the first character in each word. A word is defined as any continuous sequence of alphabet characters. An alphabet character is one between A-Z and a-z The function should return: i. A string. ii. It should return the input string with one exception: It should capitalize the first character in each word. You can use the following functions: bool isalpha (char c); // returns true if c is an alphabet character char toupper (char c); // if isalpha (c) return the // otherwise returns false // capitalized version of c // otherwise return c Example: capitalize ("this is the sea") capitalize ("this") capitalize ("this is.not") capitalize ("this,is,the sea") capitalize("This is") capitalize("") "This Is The Sea" "This" "This Is.Not" "This,Is, The Sea" "ThisIs" TI IT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
