Week 8
This week I went over some interesting videos. One video was from the playlist I mentioned in a previous blog and it was titled "Will it stop?". The video is about a problem that asks you to determine if the code will terminate(stop). To determine if it will stop we can mentally plug in numbers. n being less than or equal to 1 will stop the code so the first number we can try is 2. 2 goes in the loop and we get if ( 2%2 =0 )(true) 2/2 =1 and the code stops. So if n is 2 the code will stop. 3 goes in, if (3%2 =0) (false) 3*3+3=12 if (12 %2=0) (true) 12/2 = 6 n if (6%2 =0) (true) 6/2 =3 and we get a loop. we plug in 4 we get if (4%2=0) (true) 4/2 =2 and we know 2 stops the code. So from what we see it looks like even numbers will stop the code but if we look at the number 6 it turns out that is not true and we can see if when we can see that when we plug in 3. But when we plug in 8 it stops the code, which makes it look like that...