1 00:00:00,180 --> 00:00:03,870 Before we start, did you try solving the workbook yourself? 2 00:00:03,900 --> 00:00:09,660 If not, please click the link in the resources folder and follow the instructions for this workbook. 3 00:00:10,630 --> 00:00:12,550 Welcome to Workbook 6.8. 4 00:00:12,580 --> 00:00:16,360 Task one is to create an array that can store these string elements. 5 00:00:16,360 --> 00:00:21,340 So we'll start with that, an array that can store elements of type strings. 6 00:00:21,340 --> 00:00:22,570 What should we call it? 7 00:00:23,350 --> 00:00:26,290 How about just apples is equal to. 8 00:00:27,570 --> 00:00:29,010 The following values. 9 00:00:32,920 --> 00:00:33,550 All right. 10 00:00:34,510 --> 00:00:38,110 Create another area that stores the price of each apple. 11 00:00:38,800 --> 00:00:41,590 Simple enough, that should be double. 12 00:00:42,720 --> 00:00:45,600 An array that can store elements of type double. 13 00:00:46,680 --> 00:00:48,000 Apparently I can't type. 14 00:00:48,760 --> 00:00:50,710 Prices is equal to. 15 00:00:53,910 --> 00:00:54,840 All right. 16 00:01:00,820 --> 00:01:05,260 Task two is to use a four loop to print each apple and its price. 17 00:01:05,349 --> 00:01:11,260 This is very simple because they both have the same length of three, so you can use either length to 18 00:01:11,260 --> 00:01:12,760 set your condition in the for loop. 19 00:01:12,760 --> 00:01:13,600 It doesn't matter. 20 00:01:13,600 --> 00:01:15,910 So four and is equal to zero. 21 00:01:16,030 --> 00:01:20,050 Heck, let's just say it is smaller than three plus plus. 22 00:01:20,840 --> 00:01:25,580 You could have said here applesauce at length or you could have said prices length. 23 00:01:25,580 --> 00:01:26,810 It doesn't really matter. 24 00:01:27,140 --> 00:01:28,460 Let's go with three. 25 00:01:30,990 --> 00:01:34,580 Actually, we've been given this print statement to be used in a for loop. 26 00:01:34,590 --> 00:01:36,090 How convenient. 27 00:01:38,560 --> 00:01:42,640 Here we print the apple at index I. 28 00:01:52,630 --> 00:01:54,010 I should say, apples. 29 00:01:54,670 --> 00:01:58,210 And here we print the price at index I. 30 00:02:04,920 --> 00:02:06,000 Prices. 31 00:02:08,100 --> 00:02:08,430 All right. 32 00:02:08,430 --> 00:02:10,770 I think we are done. 33 00:02:11,430 --> 00:02:13,200 Let's visualize the runtime. 34 00:02:14,380 --> 00:02:17,050 My favorite part of every solution video. 35 00:02:18,310 --> 00:02:25,540 Okay, So here we've got two arrays, both of them with three elements. 36 00:02:25,720 --> 00:02:29,170 Our for loop is going to start at I equaling zero. 37 00:02:30,110 --> 00:02:34,550 The apple at Index zero is gala, which has a price of 199. 38 00:02:36,060 --> 00:02:36,960 Splendid. 39 00:02:37,230 --> 00:02:39,990 I A-plus plus is going to increase I to one. 40 00:02:40,620 --> 00:02:43,530 So in our second run I equals one. 41 00:02:43,710 --> 00:02:48,420 The apple at index one is Granny Smith, which is worth a dollar 49. 42 00:02:51,150 --> 00:02:53,790 Now A-plus plus increases I to two. 43 00:02:55,480 --> 00:03:01,030 The apple at Index two is a macintosh, which equals a price of $1.29. 44 00:03:02,670 --> 00:03:09,630 And now I plus plus increases I to three three is not smaller than three so the loop breaks. 45 00:03:11,000 --> 00:03:11,840 And that's it. 46 00:03:13,130 --> 00:03:14,780 Same output has learned the part. 47 00:03:14,860 --> 00:03:16,730 That means we are good. 48 00:03:17,030 --> 00:03:20,330 I hope you enjoyed yet again another break point session.