2018 MCQ Practice Exam
2018 MCQ Practice Exam
I was very happy with my results, as I ended up only getting two questions wrong.
I should have realized that the Analysis function is not being called 4 times. It is being called 4 times inside of the for loop, but is called once before the for loop itself, so that is 5 calls. Therefore, it’ll take 5 hours to execute.
This was a boneheaded mistake. Even though the first code block, Program I, has the average inside of the loop, the average will still be computed correctly as it is taking the average of all of the averages. Therefore, we are narrowed down to options C and D. But, as just explained, the average is taken every time the loop is run for Program I, therefore requiring more arithmetic operations than Program II. Therefore, option C is the best choice.