In this assignment you will write a simple program to capitalize each word in a user-inputted string. Your program will have the following features: Prompt user to enter a string. The string may be up to 100 characters. A function to capitalize each word in the string. Display the capitalized string back to the user. About Strings Please read the Just Enough About Strings page for an introduction to C strings. There is also a brief discussion on pages 133-135 of your textbook. Writing the Program On most browsers you'll see some tabs below. The first tab gives an overview of writing the program. The other tabs contains some hints to get you un-stuck if you find yourself in that position. Overview Hint: Breaking Down the Program Hint: Beginnings of Words Your program should contain two functions: main and a string handler called capitalize. You may write additional functions, but it must contain at least these two. The emphasis for this program is to learn about string handling. Therefore, please do not using any of the functions provided by string.h or ctype.h. main Your main function should: 1. Prompt the user to enter a string, 2. Call the capitalize function, passing in the string. 3. Display the resulting string, capitalize The capitalize function should loop through the string, changing each lowercase letter at the beginning of a word to its uppercase equivalent. For our purposes, a word begins at the first letter after a space. Don't worry about punctuation. The first letter in the string should also be capitalized. Look at an ASCII chart. Observe that the difference between an uppercase 'A' and lowercase 'a' is 32. This is true for all the letters. You can change a letter's case by changing its ASCII value. The changes to the string are made in-place, meaning the string is directly modified. A new string is not created. Therefore, the capitalize function does not need to return the string. This function does not print anything out. Just modify the passed-in string. It can be tempting to try to write all the code for this program at once, but you may soon find that there are lots of little details you need to keep track of. I would encourage you to take a step back and try to break down the program into smaller, more manageable pieces. Here is my suggestion for how to do so. Write main First, write the main function. All it needs to do is: 1. Prompt the user. Use printf. 2. Get input. Use fgets. 3. Call capitalize, passing in the string. 4. Print out the string. Use printf. For now, comment out step 3 (call capitalize). Compile and run the program to make sure it just parrots back what you typed in. Start capitalize Write a stub for capitalize. A stub is a function that doesn't do anything. It's just enough of the function to get it to compile and so that main can call it without causing an error. The stub looks like this: void capitalize(char[] str) { } Uncomment the line in main that calls capitalize. Your program should at least compile and be runnable, but it still doesn't capitalize anything. The point here is you are making progress. Capitalize everything We have to start capitalizing letters at some point. Might as well figure out how to do it now. To avoid getting lost in the details, simplify. Rather than capitalizing only certain letters, let's do all of them. That's actually simpler to do. Find the template string-handling loop from the Just Enough About Strings document and modify it so it: 1. Identifies a lowercase letter, 2. Changes it to uppercase. This function is going to modify the string directly rather than making a copy. To identify a lowercase letter, check to see if the character at str[i] is between 'a' and 'z'. To change it to uppercase, you have to learn a little about the ASCII character set. Upper and lowercase letters are separated by 32 ASCII values. Take a look at the ASCII Chart to see for yourself. Although we think of a string as an array of characters, each character is stored as its ASCII value in memory. Therefore, to change a lowercase letter to uppercase, just subtract 32 from its value. Yes, you can really do that to a character. Then just store the value back into the i'th position in the string