Test
Question #13:
Question #13: The answer is all of the following except number 1 because 1 indicates old enough to drive AND old enough to vote which is not what the question is asking.
Question #15 I think D is correct, making the program incorrect, because there is no way to apply the left rotate function because it only ever needs the robot to go straight and right. I think that is why D is correct.
Question #17: I think both A and D are correct because in the original code segment, you needed both segments in order for the program to come back true and that is what both A and D do.
Question #20: There are 4 tries, so when head_counter = 2, that means there will be an even amount of heads than there is tails and that is why D is the correct answer.
Question #21: I think it runs in an infinite loop is because i is assigned to 1 so it will always be 1, which means that i will never reach 4 so the program will just keep on running.
Question #22: They are both, in different ways, basically adding up all the heights and then dividing them by 32, which does give the average height of the 32 students
Question #24: It is 3y because the program runs y times and then 3, indicating that it is 3 times y and not y to the power 3, which makes more sense.
Question #26: I think the key to getting this question right is actually going through the procedure and seeing how many times it would take the robot to get into one of the positions that is indicated below. A worked.
Question #30: I think C is also correct because since the circle that is being drawn is the outer most one, the drawcircle function has to be first before the modification.
Question #32: They both store the sum but in the opposite way. Program 1 starts from 1 and goes to n and adds all those numbers, whereas program 2 starts from n and goes all the way to 1, adding the numbers as well, so they both work.
Question #33: I think this is similar to the previous question, and isn't too bad to understand.
Question #34: This basically means how many times you have to divide the number to get back to 1. ex. 500/2 = 250, 250/2 = 125, 125/2 = 63 (rounded up) and you keep going till you get to one, and then count the number of divisions it took and that is what the question is asking. The number of divisions it took this one to get to 1 is 9 and the number closest to that is 10.
Question #35: Binary search basically divides things by 2, so I think its better because you can do it with any set of numbers and it would narrow it down faster, and I think that is why B is the correct answer.
Question #36: It works because the count will only increase by one when the item in the list is equal to target, which means every time there is the word "target" the program will add one to the count.
Question #38: I think this makes sense because if the number is even, then when you subract 2 from it, it will always at some point go to 0 before it goes to any negative number, so I understand why C is the correct answer.
Question #40: I think that the random (1,3) is the range at which how many times the roboot will rotate to the right. It could rotate once and step one or two squares forward. It could rotate twice and step one or two squares forward. or it could rotate three times and step one or two squares forward. And that is why B is the correct answer, shading in the squares that could be the possible solutions.
Question #41: This basically means that if the range is set to (1,10) then there is a 2/10 possibility (20%) which is why there is a chance that it could evaulate 1 or 2, and that is why D is also the correct answer.
Question #42: All of thtem are right because those all things that you can do with a simulation, no matter how small they might seem. So D is the correct answer
Question #44: This makes sense because you can model a simulation that is like a bank, but It won't be accurate because there is no user input so it won't mimic exactly what you want. That is why D is correct.
Question #45: I couldn't find anything to help me understand this question so I don't know how to get this answer
Question #47: This is an optimization problem, hence why it is the most benefitted by a hueristic problem
Question #48: The answer is D because if you changed lines 7 and 8, the average would only need to be calculated once, and would not be in that loop and also not change the program.
Question #50: This is one that I cannot get. I really don'tt understand how to convert hexadecimal to decimal.
Reflection: I didn't do as well as i would have liked and some of these questions were pretty easy but I just had to understand the code and maybe if I had spent a little bit more time on it I would have gotten them correct. The ones that I didn't understand, no matter how hard I looked at the question, I looked at the college board videos and that helped me a little bit. I also tried the internet to see if it gave a better explanation and eventually I understood what I did wrong.