23:00:07 Hello and welcome. Today we're going to be flowcharting our peanut butter and jelly. 23:00:14 Sandwich that we made here. So first off. You know. Create, a file, PB, J, Java, file. 23:00:30 And now, so we created our Java file there. I'm gonna open. 23:00:37 Right. PBT. Okay. Here's our Java file. 23:00:50 And now we're gonna start editing it. Alright, so the first thing we did. Was 23:01:05 Great. Plus PBG. So the class name needs to be the same as the. File name so if the file name is pbj. 23:01:19 Java then The class needs to be PVJ. Okay, and close. And. And. 23:01:26 That's nice. So within inside our class, we need to create our main method. So we do public static. 23:01:38 Void main. . This Open and close. So now. 23:01:52 So let's follow our flow chart. So we imported scanner. Or some reason. So. 23:02:01 Java. We never use it, but we're just following the flow chart here. And then we create our variables, right? 23:02:13 So this is our start, right? So we start the main method. 23:02:19 And we. Stop here and stop. So we stop at the end of the main method. And then we initialize our variables, right? 23:02:35 And we only have one. We have a string array and we have bottom bread jelly. Peanut butter and top brim. 23:02:43 So it's gonna be string. Array or list of words, right? 23:02:52 In D. And equals. Make this a little bit bigger here. We said. 23:03:09 Just Curly brace. I don't read. 23:03:19 Jelly. A month? He not. Butter. 23:03:30 Comma and 23:03:36 Curly brace. Let's send my column. Okay. So. 23:03:46 Now we're here. So then, All this goes inside the for loop. 23:03:55 So, the condition and I plus plus. Well, all live in the form of So let's initialize that. 23:04:07 So we're gonna say 4. It's i equals 0. I lost them. In greedy. 23:04:17 I feel like I'm spelling that wrong. The length of the ingredients. Then I plus plus. 23:04:27 Close and then opening. 23:04:32 Close currently brace and that this is how our for loop looks the exception of that. And I I less than the length of the ingredients. 23:04:48 Hi plus plus. So this int I does not live outside this for loop. So into I only is inside this for loop And then this curly braces. 23:05:02 And oops. So let's see. Actually, let's. 23:05:14 Cool. Tap these at candle tab. 23:05:24 So this is our main method. And then this is our program. So with inside our. For loop, all we, all we do is one command, right? 23:05:37 We system operate the ingredients. So now inside our for loop, we're gonna say system. In. 23:05:49 Yeah, That's it. So we're gonna save this file. We're gonna check over our code. 23:06:04 Make sure that there is. Nothing funny going on. 23:06:12 3D and. Okay, okay. Now we're going to go back to our terminal and we're gonna say, we're gonna compile it Java C. 23:06:22 . That Java Hey, compiled. I see the. Plus. 23:06:32 Java, PB. 23:06:36 And if we compare our. Flow chart. The output in our flow chart with the output that we got. 23:06:45 So we got bottom bread. Bottom red jelly. Jelly, peanut butter, So. 23:06:55 The challenge to you was how can we get the top bread on on the top, right? So then a few of you might have done this, right? 23:07:06 There's like, well, I'm just gonna put the top bread in the beginning of the list. 23:07:09 And. The bottom bread, the end. Right. So let's see if that works out, right? 23:07:19 So we're gonna have to compile it again. Java And we're gonna run with Java. 23:07:27 . Okay Top red jelly, peanut butter, bottom. So that works out. But here's what. 23:07:37 I was intending for you to do. So instead of starting at I equals 0. You could just start at the opposite end. 23:07:48 So instead of starting at bottom bread, you could start at top red. So you could say I equals 2 in GD and that length. 23:07:59 Minus one, right? Cause the length is 4. The index of top bread is. 3. 23:08:08 So. Ingredients. Dot length minus 1, 4 minus one, equals 3. The index of the third thing is 0 1 2 3. 23:08:20 So we're gonna start here. And then we're gonna say as long as I is greater or equals to 0. 23:08:28 Because we're gonna we're gonna end that 0 and instead of going. Up the array of our list of things, we're gonna go down. 23:08:39 So we're gonna say I. Minus minus. So we're gonna go 3, 2, one. 23:08:47 0. Save this. We're gonna compile it. 23:08:56 So we're gonna say Java. TPG. Compile Java. 23:09:05 PBJ. So now we have top red peanut butter jelly and modern bread. So we see our. 23:09:15 Array or list of ingredients, right? We have top red. Peanut butter, jelly. 23:09:24 Bottom. Whereas before we had Top bread jelly peanut butter. Wow. So now our jelly is gonna go in the bottom bread and our Peanut butter is gonna go on the top red. 23:09:40 So yes, so this is how you would flowchart. For loop And this is how you program.