1 00:00:00,450 --> 00:00:00,870 ‫All right. 2 00:00:00,870 --> 00:00:04,640 ‫Now that you know how to use the race, there's a little challenge for you. 3 00:00:04,650 --> 00:00:12,180 ‫So go ahead and create a directory which contains three friends arrays in which two family members should 4 00:00:12,180 --> 00:00:12,960 ‫be stored. 5 00:00:13,200 --> 00:00:15,660 ‫So you have multiple friends, right? 6 00:00:15,660 --> 00:00:22,530 ‫So just take a friend and then add two of the family members to the eject array and then again the next 7 00:00:22,530 --> 00:00:24,030 ‫friend will be the next entry. 8 00:00:24,030 --> 00:00:28,650 ‫Create one with two family members of that friend and so forth. 9 00:00:28,650 --> 00:00:33,840 ‫So that's the idea behind this friend's array or this eject array, which contains those three friends 10 00:00:33,840 --> 00:00:34,440 ‫arrays. 11 00:00:34,440 --> 00:00:41,100 ‫So let's say you have a friend called Marta and Marta has two brothers and one is Joe and the other 12 00:00:41,100 --> 00:00:41,760 ‫is Michael. 13 00:00:41,760 --> 00:00:46,950 ‫So you would enter Joe and Michael into the first entry of that eject array. 14 00:00:47,130 --> 00:00:53,610 ‫So the next point is to introduce family members from different families to each other via console. 15 00:00:53,610 --> 00:00:58,200 ‫So this is simply a statement in which they get introduced to each other. 16 00:00:58,200 --> 00:01:04,920 ‫So simply some text where the two names are included in, and you should do that three times. 17 00:01:04,920 --> 00:01:06,900 ‫So there should be three introductions. 18 00:01:06,900 --> 00:01:11,550 ‫So please go ahead, pause the video and try to do that yourself. 19 00:01:13,630 --> 00:01:13,990 ‫All right. 20 00:01:13,990 --> 00:01:15,160 ‫I hope you tried it. 21 00:01:15,160 --> 00:01:20,760 ‫And I hope I explained it well enough so you could understand what the actual job is. 22 00:01:20,770 --> 00:01:30,490 ‫So, first of all, let's create a jagged ray, and I'm going to call that one friends and family. 23 00:01:30,490 --> 00:01:31,960 ‫Your name could be very different. 24 00:01:31,960 --> 00:01:33,010 ‫That's no problem. 25 00:01:33,010 --> 00:01:38,260 ‫And it will be a new string, jagged ray. 26 00:01:38,980 --> 00:01:49,870 ‫And I'm going to enter the data like this new string of type array containing the information like Michael 27 00:01:50,260 --> 00:01:51,700 ‫and Sandy. 28 00:01:51,790 --> 00:01:56,230 ‫So let's say I have a friend whose brother and sister are Michael and Sandy. 29 00:01:56,470 --> 00:02:06,790 ‫Then I have a new string array of another friend and he has a father who is called Frank and his mother 30 00:02:06,790 --> 00:02:08,170 ‫is called Claudia. 31 00:02:09,760 --> 00:02:21,400 ‫Then we have another entry, new string, and let's say his brother is called Andrew and his cousin 32 00:02:21,400 --> 00:02:22,810 ‫is called Michel. 33 00:02:22,810 --> 00:02:25,990 ‫So these are just some made up names, but that's fine. 34 00:02:26,170 --> 00:02:29,950 ‫And so that's the jagged ray that you were supposed to create. 35 00:02:29,950 --> 00:02:34,540 ‫Of course, you can use different names and you could even have multiple names within that string and 36 00:02:34,540 --> 00:02:38,380 ‫so forth or within that string array and so forth. 37 00:02:38,380 --> 00:02:45,520 ‫But what I'm going to do now is simply introduce, for example, Michael to Claudia or Frank to Michele 38 00:02:45,520 --> 00:02:46,630 ‫and so forth. 39 00:02:46,630 --> 00:02:47,890 ‫And how do you do that? 40 00:02:47,890 --> 00:02:54,670 ‫Well, I use console writing right line in here, and I'm just going to say something like Hi. 41 00:02:55,150 --> 00:03:02,260 ‫And then first name, I would like to introduce second name. 42 00:03:02,260 --> 00:03:05,440 ‫So one to you. 43 00:03:06,700 --> 00:03:09,730 ‫And now of course, I need to get first name and second name. 44 00:03:09,730 --> 00:03:19,480 ‫So friends and family, friends and family at zero zero is going to be introduced. 45 00:03:19,480 --> 00:03:23,830 ‫So Michael is going to be introduced to, let's say, Frank. 46 00:03:25,220 --> 00:03:33,950 ‫And Frank is going to be also friends and family at the position one and zero. 47 00:03:35,460 --> 00:03:40,590 ‫So within the second array at it's position zero. 48 00:03:40,590 --> 00:03:42,870 ‫So that's the frank that I was talking about. 49 00:03:42,870 --> 00:03:50,520 ‫So now I just copy that line and I re name or change the values here. 50 00:03:50,520 --> 00:03:55,020 ‫So let's say now I want Claudia to be introduced to Andrew. 51 00:03:55,020 --> 00:03:58,950 ‫So I'm just going to say one and here it's going to be zero two. 52 00:03:58,950 --> 00:04:09,030 ‫And now let's introduce Sandy to Michelle and that will be zero one introduced to two and one. 53 00:04:09,030 --> 00:04:10,140 ‫So this will be two. 54 00:04:10,140 --> 00:04:13,830 ‫One is my Michelle and zero one is Sandy. 55 00:04:13,920 --> 00:04:24,600 ‫So now let's go ahead and run that code and we will need the console, that red line or red key. 56 00:04:24,600 --> 00:04:27,990 ‫Now, let's go ahead and look at the code. 57 00:04:27,990 --> 00:04:30,540 ‫Let's see what the console has to show. 58 00:04:31,890 --> 00:04:33,030 ‫And there we are. 59 00:04:33,030 --> 00:04:35,100 ‫So hi, Michael. 60 00:04:35,130 --> 00:04:37,890 ‫I would like to introduce Frank to you then. 61 00:04:37,890 --> 00:04:38,640 ‫Hi, Sandy. 62 00:04:38,640 --> 00:04:43,470 ‫I would like to introduce Andrew to you and so forth. 63 00:04:43,470 --> 00:04:48,180 ‫So you see, we simply introduced our friends family to each other. 64 00:04:48,180 --> 00:04:55,620 ‫So we had a big celebration and we needed to introduce them to each other and we simply stored their 65 00:04:55,620 --> 00:04:59,190 ‫families in separate strings within our string. 66 00:04:59,190 --> 00:05:03,570 ‫So we didn't have to create ten different strings where we have all the different friends. 67 00:05:03,570 --> 00:05:09,060 ‫You could, of course, go ahead and say or create strings with the friends names. 68 00:05:10,290 --> 00:05:21,510 ‫So something like String Array and this is going to be Joe's family and then you simply have a string 69 00:05:21,510 --> 00:05:24,090 ‫array with all his family members. 70 00:05:24,090 --> 00:05:25,710 ‫That's something that you can, of course do. 71 00:05:25,710 --> 00:05:31,590 ‫But then you only have Joe's friends and here more family, and here you have all the different families, 72 00:05:31,590 --> 00:05:36,600 ‫even though we don't specify to which friends those family members belong. 73 00:05:37,320 --> 00:05:41,970 ‫By the way, if you were wondering if you could do what I just explained, you can. 74 00:05:41,970 --> 00:05:45,330 ‫So you can simply go ahead and create an array. 75 00:05:46,200 --> 00:05:52,620 ‫For example, Joe's family, and you can store that within our jaggery so you don't have to create them 76 00:05:52,620 --> 00:05:53,490 ‫all in here. 77 00:05:53,490 --> 00:05:59,520 ‫You can actually create separate arrays and position them within your jaggery. 78 00:05:59,790 --> 00:06:00,180 ‫All right. 79 00:06:00,180 --> 00:06:03,540 ‫So you're not limited to this approach that we have seen in the last video. 80 00:06:03,570 --> 00:06:05,760 ‫You can also create different arrays. 81 00:06:05,760 --> 00:06:10,410 ‫So now you could even go ahead and do the same thing with Michael Sandy and so forth. 82 00:06:10,440 --> 00:06:16,650 ‫That would make it easier for you to read to whom the different family members belong. 83 00:06:16,650 --> 00:06:18,030 ‫So to whom? 84 00:06:18,030 --> 00:06:20,070 ‫Of your friends or to which of your friends? 85 00:06:20,400 --> 00:06:21,090 ‫All righty. 86 00:06:21,090 --> 00:06:27,150 ‫So now you have seen how to use directories, and I hope you could manage to solve this sort of problem 87 00:06:27,150 --> 00:06:27,570 ‫here. 88 00:06:27,570 --> 00:06:34,410 ‫And in the next video, we are going to see parameters and how to use arrays as parameters. 89 00:06:34,410 --> 00:06:35,220 ‫So you there.