Next, I'm going to walk you through all of the problems actually on the mixed up code review page for array lists. Because I want to come back to our scaffolding of problem-solving skills and show you that all of the problems on that page can be categorized using our five groups or types of problems that we've talked about with arrays. Also with array list, we can have gathered problems, count problems, checks, problems, most wanted problems and once we got into arrays and array lists modify order promising, maybe even sometimes we put a couple those together to make one. But the idea here is that it's not a mystery. I don't want it to be a mystery for students of like there's a million problems out there, how would I ever know how to solve one that they gave me? We want to give them buckets of types of categories that they can solve. For you as the teacher how do I make other exam problems? How do I make up other examples that students should be able to do? You can use these categories as well. I'm just briefly going to go over each of the problems. It's not going to be an order because I'm actually going to group them by the type that they have. They don't actually cover all the types in these mixed up code problems, which is an interesting opportunity as you'll see, because we're going to be asking you to make your own mixed-up code problem next. Number six in the mixed up, code problems is the gather problem. So gathered, this is in fact one of our most common gathers, which is average loop over all of the things, when you're doing that, you might as well use a for loop, right? You sum it up in the middle and you do the averaging after the loop. In a most wanted problem like number four, find smallest or minimum. Again, very similar, we're going to loop over all of the things in there. So might as well use a for loop. There's going to be an if statement inside, where we're checking to see if we need to update our most wanted value and at the end we either would be printing that out, or in this case, returning it. This seems like it would try to be the trickiest. In fact, I don't think it is, but it's an interesting combination of literally putting our most wanted problem and then modify order problem together, but they don't require any integration. It's two separate parts. You'd probably want to read the description under number seven to understand it better. But basically they're saying find the largest number and then move it to the end of the array list. So this first part here is the simple, most wanted, just like the minimum one we had except just finding the largest. Again, for loop because we're looking at everything. Then afterwards we are using the value of that largest. We're removing it from where it was in the list using the remove method that array lists provide, we don't have to manually move items in the array and then using the add method to stick it on at the end. The rest of them are modified order problems because once you've got array list, that's what's neat and new and interesting over just having loops, right? Is this ordering of the items in there for both arrays and array lists is what's interesting. So there are a lot of them are what I call modify order conditionals, where you're not always modifying the order, it's based on something. So this one, we don't even have the description there, but when you go read it for number three, it says, "Remove all of the elements in the array lists that are 0." Okay? So, with modify order, you're frequently going to find that you use a while loop instead. There is an if statement inside and that especially with remove, but actually also with add. It's because you're not going to always be updating your i value the same way every time, but let me loop over I'm going to show you a variety of them and then I'll show you the similarities between them. Here's another modify order number eight. This is remove the shortest item in the array list. Now we have an array list of strings. But you'll notice there's also a while loop. There's an if statement, and then there's this funky else i plus plus, right? Because when we remove, remember it automatically shuts everything down and we got to recheck the same place we were. Another remove, remove odd, same pattern, looks like it. Another remove, remove element gives us a particular value that passed in as a parameter that's the thing we want to move, but that looks the same. So a modified order conditional now we can't say always but frequently you're going to have a while loop because again, when you're removing or adding unconditionally your index isn't going to update the same way all the time. Because it's conditionally, you're going to have an if statement. At least we only solve removes there, but one of the things we saw that was common across the remove is the increment of the i in the else, and you only incremented i if you didn't remove something. Now that's not going to be the same if it's not just a simple remove. If it's an add or if it's a remove two things, or there's other options. There's one more. Number nine is a simple modify order. There's no if statement inside, but we still got an a while loop and, "Oh This is a double list." Is that a remove or an add? It's an add. It basically says, "Take every element in the list and double it" and that's why there's a count plus equal two. So it's not an end else, but we're not just incrementing by one each time, because every time we're doing this, we're doubling it. So I introduced you to all of these because what you're going to be doing next is to make up your own mixed up code problem. You'd be like, "Well, wait, but those have to be on Runestone, and they're interactive there." I just want to show you a different style of mixed-up code problem that you can use, and can be particularly valuable as a teacher for use for summative assessments. This is the format. I'm going to give you access to this entire slide deck to use as your own, because being able to look over all of those samples that I had, I think might be helpful to you. But the idea is that we can set up something that should look somewhat similar from the Runestone. But this is a Google slide. It's just a Google slide with colors. Then what you can do to create your own mixed-up code problem is you can write the code, take screenshots of it to make your tiles or blocks, and then give students the Google slide, works best if you can keep them from using a compiler in any way, shape, or form because as a summative assessment, you are just going to see it. They have to drag the blocks from the left over to the right without any feedback. So this is really a test of their own understanding. They can see the code and visualize that as they drop it down, but they don't have any check me button. Okay? The idea is also, if you use images, it's not nearly as tempting for them to type it in because that takes them more time. But I like to use it in a situation where you can, again, you can lock their computers or their screens to keep them from being able to access a compiler on the side and use this as a summative assessment. There are other ways you could use this of course, you can use this for in-class activities and all that thing. But the idea is it's like the Runestone ones, except they're not getting the feedback, so it's harder. Okay. It's a bigger test of their knowledge. So how do you as a teacher create these? There are many ways you could do it. I'm going to tell you what works most easily for me. First, I tend to write the code over in Repl.it because I like working in Repl.it. But Repl.it has those lines that give kids a clue about the indentation, I didn't necessarily want that in this case. So then I hollered over to the Java visualizer after I have it working. Then you'll notice I've got some interesting line breaks down there. I decided and put in a line break based on how I've wanted my blocks to be. Let me go back. Because you'll notice I don't have just a single line in every block a lot like they do on Runestone, I chose to chunk it appropriately. You can chunk it for different effect. If I had pulled out the different lines of the swapping, that would have tested more difficult thing could they not only get the whole structure of the loop correctly, but can they order the lines of the swap? So you have options here as a teacher. So I then go in and put him my lines and I grab all of my screenshots at once. You'll want to look up on Windows or Mac or whatever version you have for using screenshot. You want to be able to grab a screenshot. You grab just a particular part of the screen. You'll notice there's indenting and I don't want to give that away so I always take a screenshot from the top left of where the words are and I try to make sure that I pull that into the exact same width for each thing, so that the size of the font essentially comes out the same way. You'll have to play around with that to see how that works for you. But then and here I made a bullet list because it took me a while to optimize this so that it goes as quickly as possible. So I'm giving you the advice I've gained. So before you make your copies, add helpful comments like they often have in Runestone, if desired. I don't think it tests anything more for students if you don't have this like the end method, end loop, end if okay? At least end method, end loop, okay? Screenshot each block to your desktop again, one at a time, trying to make them about the same width and so that means at some point you'll be dragging a little further. In Google slides do the following go up to upload images and select all of them at once. Upload those onto one of these blank mixed up code page, I'm providing for you. That way they will all get added into your slide in the exact same size, but they'll all be on top of each other. In fact, you'd be like what! It only give me one. It just give me the last. No, they're all there they're just stacked on top of each other. Don't click anywhere else. Right now, essentially they're all clicked and highlighted and you just can't see it. Resize that instruction that you can see to the width of the purple area and at a one point a black border. That will actually do that to all of your instructions all at once, all of your blocks, so much faster. Then once they're in the right size, and then you can just drag them up and down and reorder them into the purple space in whatever order you prefer. No, we don't have any research or anything to help us understand like is there some optimal ordering for the mixed up code? We don't. Just mix it up. Alright, I hope you'll have fun making some of your own mixed-up code problems. Next, there'll be more instructions in the next assignment. Have fun.