1 00:00:00,000 --> 00:00:00,399 2 00:00:00,399 --> 00:00:02,190 ZAMYLA CHAN: In the initials problem, we're 3 00:00:02,190 --> 00:00:05,650 going to prompt the user for their name and then print their initials. 4 00:00:05,650 --> 00:00:09,010 To prompt for the name, we'll use the get string function found in the CS 50 5 00:00:09,010 --> 00:00:12,090 library, and you're allowed to assume that this string will only 6 00:00:12,090 --> 00:00:17,490 contain letters and spaces-- so no numbers and no other characters. 7 00:00:17,490 --> 00:00:21,250 Then, once you have the string, you'll iterate through. 8 00:00:21,250 --> 00:00:23,520 >> If, say, I was using this program, then I 9 00:00:23,520 --> 00:00:26,790 might type my name perfectly-- Zamyla Chan with a capital Z 10 00:00:26,790 --> 00:00:30,510 in the beginning, a space, and then a capital C to start my last name. 11 00:00:30,510 --> 00:00:32,830 So you'd simply iterate through the string, 12 00:00:32,830 --> 00:00:36,320 getting the first character, and then the first character after a space 13 00:00:36,320 --> 00:00:38,120 and printing those out. 14 00:00:38,120 --> 00:00:41,800 >> But say you had a slightly sloppier user, Milo Banana, who 15 00:00:41,800 --> 00:00:45,420 doesn't type in uppercase and might include some extraneous space 16 00:00:45,420 --> 00:00:46,380 characters. 17 00:00:46,380 --> 00:00:48,752 Well, then when you iterate through the string, 18 00:00:48,752 --> 00:00:51,710 you'll have to check to make sure that you're not printing out a space, 19 00:00:51,710 --> 00:00:54,650 but rather, his proper initials, capital M, 20 00:00:54,650 --> 00:00:59,330 capital B. To print out capital letters, you can use the toupper function. 21 00:00:59,330 --> 00:01:01,710 And with that, you finished the problem. 22 00:01:01,710 --> 00:01:06,119 >> My name is Z. C., and this was initials. 23 00:01:06,119 --> 00:01:08,521