12:52:15 Hello. 12:52:21 Hello. 12:52:24 Pup. 12:52:28 Hello, hello, hello, hello. 12:52:40 Let's see, test number 2, take 2. Take 2. 12:52:49 Hello, do they work gonna cover loops so we're gonna flow chart loops and we're gonna go over the syntax of, for loops. 12:52:59 So then, so this is. This is a for loop. 12:53:06 And. This is where we initialize our index. So in the reason we set it to zeros. 12:53:17 So if you have a the index will always be 0. So you wanna iterate through. All the letters. 12:53:26 In our index or all the positions in our end that are in our array. So then this is somewhere. 12:53:36 To a niff condition here. So this is like, If. So we're saying if I is less than the length of A that And in our case, less than. 12:53:54 0. 1. 2 3 4 but this is the length of 12:54:04 5. So our condition if I is less than 5, we're gonna execute whatever is inside the body. 12:54:13 And then this is our mode of egress right mode of EGGRESS, 2 SS, maybe 2 G's. 12:54:27 So that's our And then if we look at our flow trip that I created up here. So this is how you start. 12:54:38 So this is everything that belongs to the fourth loop. So you have an int variable. That only exist within the for loop. 12:54:55 And then we check this condition. Is I less than the length of A? If it's true. 12:55:03 Then we go down the truth path. But if it's false, we exit the loop. Exit. 12:55:15 This case we stop. And then if it's, if it's a true statement, we execute the body of the loop, body of loop. 12:55:28 And then the last thing we do is we increment I by one. So i plus plus is the same thing as I . 12:55:41 One 12:55:43 So we're just in incrementing the value of i by one. So let's. 12:55:52 Go over this loop right here 12:55:57 So this is the body of the loop. 12:56:00 So we have an array A. That holds character value values, right? So, A, that holds character values. 12:56:11 The letter TEDD, Y. 12:56:18 So now we're gonna create our for loop. 4. And I equals 0 again. This is 0. 12:56:29 So we wanna iterate through everything in the list. Semicolon. I listed the length less than than the length. 12:56:38 Of a 12:56:43 And. 9 plus plus. 12:56:50 Curly brace. And the curly brace. So this is the end. Of loop. 12:57:00 And now inside we're gonna do a system. 12:57:05 That, that print. 12:57:10 I want all the letters in the same line, so it's just a print. Statement and not a print line statement. 12:57:18 We're gonna say A. 12:57:21 At index. Hi. 12:57:26 And let's just give it a little, little room, right? So this is a space character. 12:57:33 So, So now let's follow our loop. And then we're gonna get We're gonna have an output box. 12:57:44 Output. Our and then our variable variable. Values. And then we're gonna say, I. 12:58:00 Hi. Is. Equal to 0, right? So. 12:58:06 I guess we could just create a little. 12:58:09 . 0 So now. So this is our output. 12:58:18 So now let's start from the loop right here. So we initialize. I 2 0. Is 0. 12:58:31 Less than. That length. And what is the length of A we said 1, 2, 3, 4. 12:58:42 5 so it's 5 is 0 less than 5 12:58:48 And we say yes. So we go down the. Truth paths. So now we're gonna system up print. 12:58:55 Yeah, A at index i which is 0 So if we go back to our. A array. 12:59:12 This is index 0, right? So now we're looking at the index. And not how many. 12:59:18 3, 4. We're gonna system out print the letter T. Alright, so now after we system out print the letter T. 12:59:31 We go up this way and we get our I plus plus. So our mode of egress. So now. 12:59:42 I is no longer value at 0 but at one And now we check. Is, And we say yes, right? 12:59:55 One is less than 5. So now we. Go down the truth. Path again. 13:00:05 So this way. 13:00:07 And then we system outprints. Do you rate a at index i which In this case is value one. 13:00:19 Great. So. Give ourselves a little space. T. 13:00:26 And we. Follow this path after we print out. And we increment I by one. So now we're gonna say is 2. 13:00:37 Less than 5 we said no we system out print the 13:00:45 Index to letter. Which is the D. We increment. 13:00:53 For that to, so we increment. So before we print it out, we increment it. 13:01:01 And then we print it out. So now we do repeat the process. We're just going through the loop here. 13:01:09 So. We're just taking this loop here, right? Here, here. So that's the loop right there. 13:01:21 And we're gonna increase I by. 13:01:26 One and we're gonna print out index number 3, which is so and then we're gonna increase it to 4. 13:01:37 Is 4 less than 5 yes. 13:01:44 Print out what Why? So now we have printed everything out. And now our eye goes to. At the Valley 5. 13:01:58 So now is. 13:02:02 5 less than 5. And we say no. 5 is not less than 5, 5 is equal to 5. 13:02:11 And we stopped the program. 13:02:14 So that's a simple for loop. So now, how can we create our own program? With our knowledge of the for loop. 13:02:28 So here at Northeastern we have peanut butter. Jelly Day. After October and before December so I'm just future proving this so in in the future there's gonna be a peanut butter in jelly day hopefully and It's after October. 13:02:48 And before December. But if you take a peanut butter jelly sandwich state to any of you then I guess it's your PBN. 13:02:59 Anyway. So the idea here is to have a string array. So we're gonna flow chart it, right? 13:03:07 So we need to start. 13:03:14 We need to import a scanner just in case. So import. 13:03:21 Scanner, and, and name scanner. And we're gonna create our start space, right? 13:03:29 So now we have. A big storage space. So I want a string. 13:03:37 Alright. Of ingredients. Equals curly brace. So this could be all in one line, but. 13:03:51 I'm limited here. So we need a bottom bread. Right. 13:04:05 Jelly. 13:04:09 Great. Peanut butter 13:04:18 Not. Okay. 13:04:25 And top bread. 13:04:31 Oh, I mean, top bread. Just a imagine they're all lowercase. And that's pretty much, our ingredients for a peanut butter and jelly sandwich. 13:04:45 So this is our first iteration of the program. So we're gonna utilize the for loop to create. 13:04:53 Peanut butter and jelly sound or to print out the words. You know, bread, jelly, peanut butter, bread. 13:05:01 So. We're gonna go right into the for loop, so we're gonna say. 13:05:13 I equals 0. So again, this is inside the if statement, so it's not its own process box. 13:05:22 Usually what you could do is 13:05:26 Just put the whole 4 little statement here 4 and I equals 0. I less than, ingredients. 13:05:42 Nice, right? And then the less I plus plus. But it's just. It doesn't really flow chart very well. 13:05:54 Because the I plus plus happens at the end. Where I put it over here, right? I plus plus. 13:06:03 And then it goes back into that. Checking the condition. So I'm gonna Just initialize 13:06:13 The way. I had it in the other flow chart. Just know that it's inside the format. 13:06:22 It's i equals 0. And then we're gonna say, And then we're gonna say. 13:06:32 If, I. Less than. Ingredients. 13:06:43 Length. Okay. 13:06:46 Now we're gonna execute the true the true branch here So our true branch is gonna say 13:06:54 True branch is gonna save display, right? 13:06:59 Display system out the print line. Right, 13:07:10 Cool. 13:07:14 Ingredients 13:07:18 At sub-string or index of. Hi. 13:07:25 And that's it. And then we're gonna go back. So from here we're gonna go back to the start of the loop. 13:07:35 And somewhere in here. Should have not done that. 13:07:43 We're gonna do. Plus plus 13:07:50 And again, I plus plus is. I plus equals one. 13:08:00 Or Hi. One So this is a very cool eye. 13:08:14 So all these are the same. 13:08:22 And this one. Not. 13:08:31 Okay. But now, and once. We hit our Let's have a statement. Hmm. 13:08:47 This is our false branch and we're gonna hop over so there's no relation between that this line and this line. 13:08:57 So we're just hopping over. This is our false. We know. Stop. 13:09:08 Hey. 13:09:11 So this is our simple program. Now we're gonna have an output box. 13:09:22 And then our variable, which is I. Our value starts at 0, right? 13:09:30 So. Let's get the length of the ingredients. So ingredients is for long. So I'm just gonna write down a 4 right here. 13:09:42 And I is equal to 0. So it's 0 less than. 4, yes, we're gonna execute this line. 13:09:52 Which is ingredients at subset. I or index of 0. Which is bottom bread. 13:10:02 Red. Right, so then we increase, increase our. I by one, right? So now we're, we have. 13:10:15 I is equal to one is one less than 4. One less than 4, yes. So we're gonna system outprint our. 13:10:26 Hi, which is One. 13:10:32 And our one is jelly. 13:10:40 So now we increase I. By one by one. So now they equals 2. Now we ask is 2 less than 4. 13:10:51 We say yes, and then we print out our. 13:11:00 Second index, in greeting, which is peanut butter. Okay, peanut butter. 13:11:11 Bye. And we increase I by one again. And we say is 3 less than 4. 13:11:22 And say yes. So now we're gonna. Print out our index. Third, I don't what's just top break. 13:11:31 So top. Brett. Alright, so now we increase I. 13:11:41 And this is how we're increasing I right here. So we go here. And we increase I right there. 13:11:48 And then we check it. So now we increase our i to 4 is 4 less than 4, obviously. 13:11:57 Not so we go to our false False branch and we stop the program. So, well, there's a issue with our. 13:12:09 Peanut butter jelly sandwich here. Our bottom bread. In the top. In our top bridge is in the bottom. 13:12:18 So I guess if you find the solution to this. Problem here. You know, I mean, what is really up? 13:12:28 What's up? So. Yeah, so let me know if you have any more questions about for loops.