 a question 7. So with question 7 we want to create or declare and create our arrays and then using a loop we want to assign some values. So 7.1 we want an integer array to hold 50 integers. So if we just look at that part on its own that's achievable with these questions we can split it up into two parts. So we want an integer array with 50 integers. Integer array, let's call it data, is a new int array with 50 spaces. Easy. Second part is assign each item a random value between 1 and 6 and that's including 1 and 6. So first we want a loop that goes through our whole array where our loop variable represents the index. So we'll start at index 0. We go for data.length. We can write 50 but it's just good habits to write data.length and then for each item I want a random number between 1 and 6 so I can use the random method where the first parameter is the first number and the second one is the last one. And remember as well that the first number you give is inclusive so it's including that number but the second one is exclusive so it won't have the number 7 because this is returning floats and we want to round them down as integers and so our higher float numbers will be rounded down to 6. So from numbers 1 to 6 that works. Oh I've written ARR. Let's just have it. Cool. So now I've got an array where each number or each value is assigned a random number between 1 and 7 not including 7. 7.2 I'm creating another array so I'll say data. Let's not do data. Let's do ARR this time since I'll probably write it anyway. So again I've got an integer array with 50 integers and we're populating it again so it's similar code. I'm going to copy and paste that but what we're assigning is different and we need to work out some patterns here. So the first item is 10, the second one is 12, third is 14, fourth is 16 and so on. So let's use our table again to work that out. Get my table up. Great. So the first item is 10, second one is 12, 14, 16 and so on so I'll assume that's 18. Okay so again two ways to do this question. You can have a variable which has a value of 10 and then plus 2 each time that you go around the loop so that you're increasing by 2 each time but I'm sure that we can write this in terms of i. We just need to do some trial and error. So what if I did 10 plus 2 times 1? That works. 10 plus 2 times 2, 10 plus 2 times 3. Okay that looks good and then this one is 10 plus 2 times 0. Awesome. So we know we're starting at 10 and each time we're plusing 2 so we can relate how much twos we're adding on to our our rate index. So if we have a look at our pattern we've got all of our i variables of what we're multiplying and then everything else here is consistent. We've got 10 plus 2, 10 plus 2 and there are other patterns that you can find as well but this one works well I think 10 plus 2 times i. Great and that is question 7. Again there are other ways probably not to do 7.1 but there are other ways to do 7.2. Oh this time I wrote data last time I wrote oh and this time I wrote data I just can't get it right. Yes so there's different ways to do 7.2 as long as it works then that's good but I'd say this is probably one of the more efficient ways because we're using our loop variable rather than creating a new one.