1 00:00:00,830 --> 00:00:02,640 - [Instructor] In this self-check exercise, 2 00:00:02,640 --> 00:00:06,140 we'd like you to take advantage of string concatenation 3 00:00:06,140 --> 00:00:10,740 and string repetition to create a concatenation 4 00:00:10,740 --> 00:00:12,730 of your first and your last name 5 00:00:12,730 --> 00:00:16,120 and then to use the repetition operator 6 00:00:16,120 --> 00:00:19,260 to create a bar of asterisks that's the same length 7 00:00:19,260 --> 00:00:22,630 as your concatenated name, and display that bar 8 00:00:22,630 --> 00:00:25,460 above and below your name as well. 9 00:00:25,460 --> 00:00:28,960 So go ahead and pause the video to give that a shot, 10 00:00:28,960 --> 00:00:31,033 and then come back to see the results. 11 00:00:36,090 --> 00:00:39,350 Okay, let's start out by assuming we have 12 00:00:39,350 --> 00:00:43,090 a first name and a last name, Pam and Black, 13 00:00:43,090 --> 00:00:47,160 and we're going to assign to name the string Pam 14 00:00:47,160 --> 00:00:48,930 and we're going to concatenate 15 00:00:48,930 --> 00:00:51,010 with that the string Black. 16 00:00:51,010 --> 00:00:53,500 So if I go ahead and execute those, 17 00:00:53,500 --> 00:00:58,430 I now have Pam space Black as the value of name, 18 00:00:58,430 --> 00:01:01,080 and the next thing I'm going to do is define 19 00:01:01,080 --> 00:01:04,820 a bar variable, which is just a single asterisk, 20 00:01:04,820 --> 00:01:08,000 and let's repeat that by the length 21 00:01:08,000 --> 00:01:11,110 of the newly concatenated name string. 22 00:01:11,110 --> 00:01:15,320 So bar times equals len name is going to figure out 23 00:01:15,320 --> 00:01:18,970 the proper number of characters in Pam space Black. 24 00:01:18,970 --> 00:01:21,490 Repeat the asterisk that number of times 25 00:01:21,490 --> 00:01:23,760 and store the result in bar, 26 00:01:23,760 --> 00:01:25,690 and then finally we can go ahead 27 00:01:25,690 --> 00:01:28,780 and display the bar, a new line, the name, 28 00:01:28,780 --> 00:01:31,260 a new line, and the bar again, 29 00:01:31,260 --> 00:01:34,110 and as you can see here indeed we get Pam Black 30 00:01:34,110 --> 00:01:37,393 with the correct number of asterisks above and below.