final tri 1 review
final practice test tri 1 review
score of final
problem review
Problem 1
I got this problem wrong because I simply did not know how to work with binary numbers.
How to convert binary to numbers
binary works in that each number has a decimal value, and that number will add onto the full value. for example. to find the value of 1011, you would convert 1 to 2^3, 0 to 0, 1 to 2^1, and the last 1 to 2^0. the power the 2s goes to is determined by the place it is in the binary.
1 0 1 1
1 would be 4ths place
0 would be 3rd place if 1 was there
1 would be 2nd place
and last 1 would be 0 place
then we add all of the values together, which would add up to 8 + 2 + 1 which is 11.
I only got this problem wrong because I had no idea how binary numbers worked, but now, I am sure that I will get problems like this right next time.
problem 2
My problem here was that i mistakenly gave p its original value the fifth statement, p <— q makes p equal q, which is 20.
last statement setting r equal to p should have been 20 because p had been initialized to 20 earlier, but I must have glossed over the 5th statement and read through the code too quickly, because I thought that p was still it’s original value, 10. Next time, I need to make sure that I completely read through pseudo code problems like this many times over to confirm that I understand the entirety of the problem.
problem 3
my error here was that I was thinking about this too hard and trying to work out what happens at each runthrough of the loop. I should have looked at things from a math perspective and realized what the loop was essentially doing, not what is happening at each playthrough of the loop.
basically, this problem is adding x to itself 5 times. so the first time, x is 1, which then adds 2 to that 1, and so on until x is 5. My mistake was that I was thinking too hard about it, and stopped at the 4th runthrough of the loop. I forgot to add that last five. I think that I will need to work on understanding for loops more and math functions in general so that I don’t slip up like this again
reflection
I feel like I am doing pretty good in my knowledge of pseudo code and networking, as I did well on those problems. the hard ones that gave me a challenge were the ones that I did not understand, like the binary problems. I think that to do better on the next test, I need to think critically and slowly read through the problem to ensure I know exactly how the problem will be run through. But for now, I think i am doing pretty well.